Commit graph

43 commits

Author SHA1 Message Date
bors
b68992a510 Auto merge of #17907 - ChayimFriedman2:no-once_cell, r=Veykril
internal: Replace once_cell with std's recently stabilized OnceCell/Lock and LazyCell/Lock

This doesn't get rid of the once_cell dependency, unfortunately, since we have dependencies that use it, but it's a nice to do cleanup. And when our deps will eventually get rid of once_cell we will get rid of it for free.
2024-08-16 07:05:59 +00:00
Chayim Refael Friedman
642a0f84ca Replace once_cell with std's recently stabilized OnceCell/Lock and LazyCell/Lock
This doesn't get rid of the once_cell dependency, unfortunately, since we have dependencies that use it, but it's a nice to do cleanup. And when our deps will eventually get rid of once_cell we will get rid of it for free.
2024-08-16 09:53:37 +03:00
Shoyu Vanilla
4ea0db907c Bump rustc_pattern_analysis 2024-08-13 23:15:37 +09:00
bors
bdc0b7859f Auto merge of #17861 - Veykril:bump-lock, r=Veykril
minor: Bump lockfile
2024-08-12 11:05:08 +00:00
Lukas Wirth
69f613892a minor: Bump lockfile 2024-08-12 11:51:43 +02:00
mo8it
f4b1b4bb82 Use Sender instead of boxed closure in vfs 2024-08-09 23:40:32 +02:00
Lukas Wirth
1114de0c37 Move flycheck crate into rust-analyzer main crate 2024-08-08 13:06:39 +02:00
bors
7dd258a36d Auto merge of #17771 - Veykril:parallel-vfs-config, r=Veykril
internal: Load VFS config changes in parallel

Simple attempt to make some progress f or https://github.com/rust-lang/rust-analyzer/issues/17373
No clue if those atomic orderings are right, though I don't think they are really too relevant either.

A more complete fix would probably need to replace our `ProjectFolders` handling a bit.
2024-08-05 14:07:22 +00:00
Lukas Wirth
314f30167f Slightly optimize watch list in vfs 2024-08-05 15:56:23 +02:00
bors
9d99d39eaf Auto merge of #17799 - Veykril:syntax-bridge, r=Veykril
Split out syntax-bridge into a separate crate

This functionality is not really tied to mbe macros, so imo it has no place in that crate.
2024-08-05 12:31:45 +00:00
Lukas Wirth
cdee65f5ea Newtype ErasedFileAstId 2024-08-05 13:46:47 +02:00
Lukas Wirth
90803b16c1 Split out syntax-bridge into a separate crate 2024-08-05 13:45:00 +02:00
Lukas Wirth
07e6f9d918 internal: Load VFS config changes in parallel 2024-08-02 13:04:15 +02:00
Lukas Wirth
5ac2ad4eaf internal: Remove AbsPathBuf::TryFrom impl that checks too many things at once 2024-08-02 11:08:19 +02:00
David Barsky
2e582ad848 feature: move linked_projects discovery to the rust-analyzer server 2024-07-18 12:01:27 -04:00
Lukas Wirth
41451a26e9 Remove Name::to_smol_str 2024-07-16 12:43:58 +02:00
Lukas Wirth
1a20a0803f More symbol usage 2024-07-16 12:05:16 +02:00
Lukas Wirth
9ce066e6fa Use symbol in cfg 2024-07-16 10:41:42 +02:00
Lukas Wirth
7f8a54bbee Switch token trees to use Symbols 2024-07-16 10:11:59 +02:00
Lukas Wirth
311aaa5a79 Fix incorrect encoding of literals in the proc-macro-api on version 4 2024-07-15 14:51:01 +02:00
Lukas Wirth
6af77a624e Encode ident rawness and literal kind separately in tt::Leaf 2024-07-15 12:24:40 +02:00
Lukas Wirth
1bafedbfe9 Implement rough symbol interning infra 2024-07-12 16:01:47 +02:00
beetrees
69424f7666
Add f16 and f128 support 2024-07-10 10:43:14 +01:00
Lukas Wirth
58ec8b2028 Drop sourcegen 2024-07-07 09:00:19 +02:00
Lukas Wirth
2d14f47eb7 Move feature-doc generation to xtask codegen 2024-07-07 09:00:18 +02:00
Lukas Wirth
20dc1b615d Drop unused profile things 2024-07-07 08:24:10 +02:00
Lukas Wirth
d40bc51e3d Bump rustc_pattern_analysis 2024-06-30 18:41:55 +02:00
Lukas Wirth
1653889bad Remove serde flag from indexmap dependency 2024-06-30 18:14:53 +02:00
Lukas Wirth
b1518b262e Simplify 2024-06-30 16:43:22 +02:00
Lukas Wirth
fd9dce7fb8 Move dylib version stuff to proc-macro-srv 2024-06-30 15:05:35 +02:00
Lukas Wirth
3db288136e move tt-iter into tt crate 2024-06-24 14:47:21 +02:00
Lukas Wirth
04b6b04092 Shrink mbe's Op 2024-06-24 10:07:32 +02:00
roife
80a2ac5681 internal: simplify and refactor write_where_clause 2024-06-11 21:02:13 +08:00
bors
a9f0e206d9 Auto merge of #17058 - alibektas:13529/ratoml, r=Veykril
feat: TOML based config for rust-analyzer

> Important
>
> We don't promise _**any**_ stability with this feature yet, any configs exposed may be removed again, the grouping may change etc.

# TOML Based Config for RA

This PR ( addresses #13529 and this is a follow-up PR on #16639 ) makes rust-analyzer configurable by configuration files called `rust-analyzer.toml`. Files **must** be named `rust-analyzer.toml`. There is not a strict rule regarding where the files should be placed, but it is recommended to put them near a file that triggers server to start (i.e., `Cargo.{toml,lock}`, `rust-project.json`).

## Configuration Types

Previous configuration keys are now split into three different classes.

1. Client keys: These keys only make sense when set by the client (e.g., by setting them in `settings.json` in VSCode). They are but a small portion of this list. One such example is `rust_analyzer.files_watcher`, based on which either the client or the server will be responsible for watching for changes made to project files.
2. Global keys: These keys apply to the entire workspace and can only be set on the very top layers of the hierarchy. The next section gives instructions on which layers these are.
3. Local keys: Keys that can be changed for each crate if desired.

### How Am I Supposed To Know If A Config Is Gl/Loc/Cl ?

#17101

## Configuration Hierarchy

There are 5 levels in the configuration hierarchy. When a key is searched for, it is searched in a bottom-up depth-first fashion.

### Default Configuration

**Scope**: Global, Local, and Client

This is a hard-coded set of configurations. When a configuration key could not be found, then its default value applies.

### User configuration

**Scope**: Global, Local

If you want your configurations to apply to **every** project you have, you can do so by setting them in your `$CONFIG_DIR/rust-analyzer/rust-analyzer.toml` file, where `$CONFIG_DIR` is :

| Platform | Value                                 | Example                                  |
| ------- | ------------------------------------- | ---------------------------------------- |
| Linux   | `$XDG_CONFIG_HOME` or `$HOME`/.config | /home/alice/.config                      |
| macOS   | `$HOME`/Library/Application Support   | /Users/Alice/Library/Application Support |
| Windows | `{FOLDERID_RoamingAppData}`           | C:\Users\Alice\AppData\Roaming           |

### Client configuration

**Scope**: Global, Local, and Client

Previously, the only way to configure rust-analyzer was to configure it from the settings of the Client you are using. This level corresponds to that.

> With this PR, you don't need to port anything to benefit from new features. You can continue to use your old settings as they are.

### Workspace Root Configuration

**Scope**: Global, Local

Rust-analyzer already used the path of the workspace you opened in your Client. We used this information to create a configuration file that won't affect your other projects and define global level configurations at the same time.

### Local Configuration

**Scope**: Local

You can also configure rust-analyzer on a crate level. Although it is not an error to define global ( or client ) level keys in such files, they won't be taken into consideration by the server. Defined local keys will affect the crate in which they are defined and crate's descendants. Internally, a Rust project is split into what we call `SourceRoot`s. This, although with exceptions, is equal to splitting a project into crates.

> You may choose to have more than one `rust-analyzer.toml` files within a `SourceRoot`, but among them, the one closer to the project root will be
2024-06-07 10:49:02 +00:00
Wilfred Hughes
9e31bce003 chore: Update Cargo.lock to avoid yanked version 2024-06-05 17:36:36 -07:00
Ali Bektas
53b5038b54 Apply suggested changes 2024-06-05 10:45:19 +02:00
Henry Chen
772e48cfbb minor: replace command-group with process-wrap
Because command-group no longer receives updates and depends on an
older version of nix.
2024-05-31 12:43:40 +08:00
Laurențiu Nicola
c944b01b81 Bump rustc crates 2024-05-19 11:22:58 +03:00
Lukas Wirth
fc71d49bc1 Bump Cargo.lock 2024-05-14 10:57:02 +02:00
Kenny Kerr
60cac54e83 Update rust-analyzer to use windows-sys crate 2024-05-01 09:04:13 -05:00
bors
afa2a898a4 Auto merge of #17102 - davidbarsky:david/add-some-tracing-to-project-loading, r=lnicola
chore: add some `tracing` to project loading

I wanted to see what's happening during project loading and if it could be parallelized. I'm thinking maybe, but it's not this PR :)
2024-04-22 15:56:06 +00:00
David Barsky
2d4723b38b chore: add some tracing to project loading 2024-04-22 11:39:01 -04:00
Laurențiu Nicola
8f2138102f Use josh for subtree syncs 2024-04-21 10:07:08 +03:00