-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
RLS linting reports incorrect/outdated information due to two separate processes #2239
Comments
Could be that ALE doesn't handle that case correctly and spawns two RLS instances. This is the code which looks for the project root for RLS: https://github.com/w0rp/ale/blob/master/ale_linters/rust/rls.vim#L13-L17 As you can see it looks for |
Maybe the better heuristics would be to look for But the correct fix would be to make ALE to use cargo to fid the workspace root (does cargo has this feature?). |
It doesn't appear to have a command for that unfortunately. I like your idea of looking for cargo.lock though... Pretty sure all workspaces must share the same lock file between it's packages. |
@matt961 could try to fix it and send a PR if fix is working? |
I'd suggest to make a feature request to cargo to add this or even ask them to provide |
Tomorrow I will try a fix. Probably the cargo team would be open to a working dir command. |
I was about to post exactly the same bug report. |
Looking for |
See rust-lang/cargo#4933, new cargo returns root in
It doesn't exist all the time probably, but a good fallback if |
The ever unstable Rust. |
hmm must have been looking at an outdated manual, didn't know about the metadata command. Someone else should do a fix if we're not using Cargo.lock, I'm not vimscript savvy. By the looks of it, the cargo team won't change this functionality without good reason, it's been in place since rust 1.24 which is I believe over a year old. |
Closing because 3 years later, |
Information
VIM version
NVIM v0.3.1
Build type: Release
Operating System: Linux 4.4.0-17763-Microsoft # 253-Microsoft Mon Dec 31 17:49:00 PST 2018 x86_64 x86_64 x86_64 GNU/Linux
What went wrong
When working in a cargo workspace with two packages and editing files from both, adding a function to one package that is a lib, and then trying to get code completion for it in the main function of the other package, it reports that no function is found. Using ALE to stop the language servers and then editing the bad-lint reporting file lets the out-of-date RLS catch up to the most recent state of the other package that it isn't monitoring. Since I don't think its watching the other package's directory, it doesn't notice the file change and doesn't incrementally compile.
I'm just about certain that this is why it is printing out of date lints since this works fine with LanguageClient-neovim and I could only find one rls PID from the output of
ps aux
vs when using ALE I could find two separate PIDs.Reproducing the bug
use add_one::add_one;
in theadder
package, RLS throws an error saying that the function doesn't exist, but it resolves just fine when invokingcargo build
.:ALEInfo
uhh ohh ^ two separate processes
ps aux
when using ALE'ps aux' when using LanguageClient-neovim
The text was updated successfully, but these errors were encountered: