-
Notifications
You must be signed in to change notification settings - Fork 1.7k
RA shows warnings in autogenerated files inside target directory when using alternative target location #12685
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
Does running In general I would expect warnings to show up in generated files as usual. If you don't want to see them, you can The reason why you only see the warnings for one file is that this is the current generated file; the other ones are older versions that are not part of the crate anymore. And I suspect the reason why you're only seeing them now with a separate target folder is that |
(Lastly, I wouldn't usually recommend using a different target folder for RA. Unless you have something in your setup that results in different build parameters being used when RA runs |
Hmm, it does. I was convinced it wouldn't because VSCode doesn't show anything in the default
Yeah, this makes sense.
Both
I have VSCode set to save when it loses focus which triggers RA which locks |
It doesn't block the build, it starts it opportunistically, so it's often finished by the time you type |
It might seem like you're blocked since you're seeing the "waiting for lock" message, but in practice you're just waiting for the time I'm not sure why warnings aren't shown for |
I think there's a recent regression where the |
I don't think that's it, since diagnostics in other files show up. |
This is absolutely not my experience. I have set RA to run clippy on save, I configured VSC autosafe delay to 100 ms (so it can often actually save and start analyzing before it loses focus, i forgot i made this change) but when I switch to my terminal,
I almost never do Also note that i want clippy lints in VSC and clippy takes way longer than build and still blocks the target dir.
That's a good point i haven't considered yet. OTOH i only care about incremental build times so only the topmost crate in the dep tree is being checked/built. I believe rustc isn't very parallelized and so This discussion is probably a bit off-topic for this issue, though i don't mind continuing it here. OTOH this is something that probably deserves a lot deeper investigation because build times are by far the worst part of using rust for me, using a separate target for RA has improved it massively and yet i have not seen it suggested anywhere else (and in fact most articles about build times are about from-scratch, not incremental, which is strange). Back to the issue:
I looked at Output -> Rust Analyzer Language Server (when using the normal shared
That's the path of the file that should show the warns but doesn't. There's also:
|
That stack trace comes from you using a nightly thats too new for r-a right now, the proc-macro abi changed again which causes us to fail expanding them. #12600 |
rust-analyzer version: 0.0.0 (cc0bb71 2022-07-02)
rustc version: rustc 1.64.0-nightly (46b8c23f3 2022-07-01)
relevant settings:
I use
target-ra
as a separate target directory for RA in VSCode. My project useslalrpop
which puts generated files in this target directory. RA shows warnings in one of these autogenerated files (target-ra/debug/build/fml-738faf2a1534b33c/out/fml.rs
). I think this is a bug because it doesn't show warnings if using the normal sharedtarget
directory and in general it makes no sense to show warns in files i can't do anything about.It can be reproduced on this repo on the
ra-bug
branch. It contains a .vscode config that should contain everything needed - the warnings should be visible as soon as RA finishes analyzing the project:Interestingly, there are other
target-ra/debug/build/fml-*/out/fml.rs
files but it only happens with this particular one.The text was updated successfully, but these errors were encountered: