-
Notifications
You must be signed in to change notification settings - Fork 1.7k
rust-analyzer ignores linkedProjects after version 0.4.2040 #17664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Someone suggested me that it simply ignores the setting rust-analyzer.linkedProjects because it creates the target directory only in the root directory, which may be the true cause of all of it, so I changed the tittle of the issue |
I am experiencing similar with this new version, code generated and included in the project is not being indexed in this recent update where it was before, I have reverted to 0.3.2037 and rust-analyzer now functions as expected. When viewing generated files I am also not being warned that the project is unindexed (unsure whether this behavior is intended). I have written an example (possibly overkill) of how this manifests with files generated by the rust-protobuf crate. rust-analyzer version: 0.3.2045 rustc version: rustc 1.79.0 (129f3b996 2024-06-10) editor or extension: vscode, rust-analyzer version: 0.3.2045 relevant settings: "rust-analyzer.notifications.unindexedProject": true |
I'm really sorry about the workflow disruption: I know how annoying it is. I'll work on fixing this regression today. |
Right, okay:
|
Ah apologies for reporting it here and thank you very much for your work on these issues, glad the reproduction helped! |
@davidbarsky #17660 fixed the regression reported by @fw-cc. |
I missed that PR, my bad! It seems like it landed just after the weekly release was cut. |
Hello 👋
EDIT: This is on Windows 10 22H2 (19045.4651) |
Unfortunately using I'm using a {
"lsp": {
"rust-analyzer": {
"linkedProjects": [
"${workspaceFolder}/rust/ares/Cargo.toml",
"${workspaceFolder}/rust/ares_crypto/Cargo.toml",
"${workspaceFolder}/rust/ares_guard/Cargo.toml",
"${workspaceFolder}/rust/ares_macros/Cargo.toml",
"${workspaceFolder}/rust/ares_pma/Cargo.toml",
"${workspaceFolder}/rust-assert-no-alloc/Cargo.toml"
]
}
}
} |
Like @matthew-levan, I'm also running Appreciate the work y'all are doing and let me know if there's any more information I could provide. |
Without this change, `linkedProjects` stopped taking effect. <rust-lang/rust-analyzer#17664>
I am also encountering this issue today. |
Update: I used absolute paths (that don't rely on interpolation, i.e. |
I also randomly started encountering this issue on all versions I tried today ( project.workspace {
"settings": {
"rust-analyzer.linkedProjects": [
"path/to/project/Cargo.toml",
...
],
}
} I switched using a [workspace]
members = [
"path/to/project",
...
]
On |
This fixed it for me: "lsp": {
"rust-analyzer": {
"initialization_options": {
"linkedProjects": ["/Users/my-username/path/to/Cargo.toml"]
}
}
} |
@davidbarsky any updates on this? This does look like a rather annoying problem (just ran into this with the default rust-lang/rust config) |
I wasn't able to reproduce it (I'm still unable to...), but I realized that I made |
Opened #17750. |
…irement-in-linked-projects, r=Veykril fix: remove AbsPath requirement from linkedProjects Should (fingers crossed!) fix rust-lang/rust-analyzer#17664. I opened the `rustc` workspace with the [suggested configuration](https://github.com/rust-lang/rust/blob/e552c168c72c95dc28950a9aae8ed7030199aa0d/src/etc/rust_analyzer_settings.json) and I was able to successfully open some rustc crates (`rustc_incremental`) and have IDE functionality. `@Veykril:` can you try these changes and let me know if it fixed rustc?
rust-analyzer version: 0.4.2042 (and all above this version)
rustc version: rustc 1.82.0-nightly (92c6c0380 2024-07-21)
editor or extension: vscode, rust-analyzer version: 0.4.2044-standalone
relevant settings: my .vscode/settings.json uses the following options: rust-analyzer.linkedProjects, rust-analyzer.checkOnSave.allTargets, rust-analyzer.cargo.noDefaultFeatures, rust-analyzer.check.command
Basically, every version after 0.4.2040 doesn't work, at all. There are no relevant logs to it, nothing. Rust analyzer still shows warnings at the problems tab, but nothing in the editor itself shows up, no tips, no "go to declaration" buttons are working.
I tried cargo cleaning all directories of all project, purging ~/.rustc and ~/.cargo, nothing. The only difference in the working rust analyzer version is that the ram usage is a bit higher, around a GB
The text was updated successfully, but these errors were encountered: