summary refs log tree commit diff
path: root/src/tools/rust-analyzer/crates/load-cargo
AgeCommit message (Collapse)AuthorLines
2025-03-07Log build script error output in `load_cargo::load_workspace_at`Arthur Baars-0/+8
2025-02-17Use correct working directory for non-workspace proc-macro executionMehul Arora-1/+0
2025-02-05Do not include excluded files even when the client opens themChayim Refael Friedman-1/+3
This require a pretty big modification, because this is a new kind of file: exists - but ignore it.
2025-01-24Explicitly add buildfiles when constructing ProjectFoldersDavid Richey-0/+18
2025-01-16Partially back out "fix: Fix sourceroot construction for virtual manifests"Lukas Wirth-4/+1
2025-01-02Store token trees in contiguous `Vec` instead of as a treeChayim Refael Friedman-5/+5
I expected this to be faster (due to less allocations and better cache locality), but benchmarked it is not (neither it is slower). Memory usage, however, drops by ~50mb (of `analysis-stats .`). I guess tt construction is just not hot. This also simplifies using even less memory for token trees by compressing equal span, which I plan to do right after. Some workflows are more easily expressed with a flat tt, while some are better expressed with a tree. With the right helpers, though (which was mostly a matter of trial and error), even the worst workflows become very easy indeed.
2024-12-30Move proc-macro protocol into legacy moduleLukas Wirth-1/+1
2024-12-30Decouple proc-macro server protocol from the server implementationLukas Wirth-6/+6
2024-12-18Remove salsa from proc-macro server dep treeLukas Wirth-1/+1
2024-12-12fix: Fix sourceroot construction for virtual manifestsLukas Wirth-41/+5
2024-12-09Fix config guard lock for ratoml testsLukas Wirth-2/+2
2024-12-07Watch for user config ratomlAli Bektas-2/+22
2024-09-30Gate `#[test]` expansion under `cfg(test)`.Chayim Refael Friedman-4/+1
This will mean users opting to not activate `cfg(test)` will lose IDE experience on them, which is quite unfortunate, but this is unavoidable if we want to avoid false positives on e.g. diagnostics. The real fix is to provide IDE experience even for cfg'ed out code, but this is out of scope for this PR.
2024-09-30Provide an config option to not set `cfg(test)`Chayim Refael Friedman-0/+3
2024-09-26Include buildfiles in vfsDavid Richey-0/+5
2024-09-11Properly set the working directory for proc-macro executionLukas Wirth-1/+10
2024-09-11Lift out workspace related data into a separate query to preserve crategraph ↵Lukas Wirth-6/+10
deduplication
2024-08-12Auto merge of #17864 - Veykril:lsif, r=Veykrilbors-0/+10
fix: Build and run build scripts in lsif command
2024-08-12Build and run build scripts in lsif commandLukas Wirth-0/+10
2024-08-09Use Sender instead of boxed closure in vfsmo8it-2/+1
2024-08-06Replace `[package.repository] = "…"` of published crates with ↵Vincent Esche-1/+1
`[package.repository.workspace] = true`
2024-08-06Unify package descriptions by adding references to "rust-analyzer"Vincent Esche-1/+1
With the lack of a README on the individually published library crates and the somewhat cryptic `ra_ap_` prefix it is hard to figure out where those crates belong to, so mentioning "rust-analyzer" feels like auseful hint there.
2024-08-06Add repository URL for published crates' missing `[package.repository]` fieldsVincent Esche-0/+1
2024-08-06Replace `"TBD"` with more helpful desciptions in published crates' ↵Vincent Esche-1/+1
`[package.description]` fields
2024-08-05Auto merge of #17771 - Veykril:parallel-vfs-config, r=Veykrilbors-3/+7
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-05feat: Load sysroot library via cargo metadataLukas Wirth-2/+2
2024-08-02internal: Load VFS config changes in parallelLukas Wirth-3/+7
2024-07-26Internal: Cleanup proc-macro error handlingLukas Wirth-8/+10
2024-07-23minor changesAli Bektas-6/+8
2024-07-22Read rust-analyzer.toml files on startupAli Bektas-8/+27
2024-07-19Auto merge of #17639 - Veykril:salsa-perf, r=Veykrilbors-1/+1
Some more small salsa memory improvements This does limit our lru limits to 2^16 but if you want to set them higher than that you might as well not set them at all. Also makes `LRU` opt-in per query now, allowing us to drop all the unnecessary LRU stuff for most queries
2024-07-19Reduce maximum LRU size to 2^16 entries, reducing memory footprint of LRU ↵Lukas Wirth-1/+1
entries
2024-07-18feature: move `linked_projects` discovery to the rust-analyzer serverDavid Barsky-2/+0
2024-07-16Remove Name::to_smol_strLukas Wirth-3/+9
2024-06-20fix: ensure there are no cycles in the source_root_parent_maproife-21/+63
2024-06-10fix: ensure that the parent of a SourceRoot cannot be itselfroife-3/+23
2024-06-09Register virtual workspace Cargo.toml files in the VFSLukas Wirth-1/+14
2024-06-07Auto merge of #17058 - alibektas:13529/ratoml, r=Veykrilbors-6/+5
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-07Fix processing of ratoml filesLukas Wirth-6/+5
2024-06-06chore: Prefer tracing span shorthand macrosWilfred Hughes-3/+3
2024-05-14Hash file contents to verify whether file actually changedLukas Wirth-2/+2
2024-04-30fix: Tracing span names should match function namesWilfred Hughes-1/+2
When viewing traces, it's slightly confusing when the span name doesn't match the function name. Ensure the names are consistent. (It might be worth moving most of these to use #[tracing::instrument] so the name can never go stale. @davidbarsky suggested that is marginally slower, so I've just done the simple change here.)
2024-04-26Show workspace info in the status barLukas Wirth-2/+2
2024-04-22Auto merge of #17102 - ↵bors-0/+3
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-22chore: add some `tracing` to project loadingDavid Barsky-0/+597
2024-04-21Extract common fields out of ProjectWorkspace variantsLukas Wirth-3/+1
2024-04-21Allow rust files to be used linkedProjectsLukas Wirth-0/+596