Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

RLS/Clippy doesn't lint newly created files #921

Open
stinodego opened this issue Aug 1, 2021 · 6 comments
Open

RLS/Clippy doesn't lint newly created files #921

stinodego opened this issue Aug 1, 2021 · 6 comments

Comments

@stinodego
Copy link

stinodego commented Aug 1, 2021

Whenever I create a new .rs file in my project, I don't receive any warnings/lints until I restart VSCode. After I restart, everything works as expected.

I'm sure I must be doing something wrong; could someone help me out?

I am using VSCode through Windows Subsystem for Linux.

UPDATE: Including the file as a module in lib.rs fixes the issue. However, creating a main.rs is still problematic, as this file is not included in lib.rs.

@lnicola
Copy link
Member

lnicola commented Aug 1, 2021

Can you try https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer instead (though it might be a bit finicky to set up in WSL -- you need to install it on the remote side and make sure everything is in PATH).

@stinodego
Copy link
Author

Sure, I'll give that a shot! Will report back.

@stinodego
Copy link
Author

Can you try https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer instead (though it might be a bit finicky to set up in WSL -- you need to install it on the remote side and make sure everything is in PATH).

Yes, if I disable the Rust extension and enable rust-analyzer instead, everything works as expected. Installing was easy by the way, no need to mess around with PATH or anything.

How does this extension compare to the "Rust" extension otherwise?

@lnicola
Copy link
Member

lnicola commented Aug 1, 2021

See https://rust-analyzer.github.io/blog/2020/04/20/first-release.html and https://rust-lang.github.io/compiler-team/working-groups/rls-2.0/. It's supposed to replace RLS at some point, but it's currently developed outside of the Rust project.

How does this extension compare to the "Rust" extension otherwise?

Favourably, in my (biased, as a rust-analyzer contributor) opinion :-).

@stinodego
Copy link
Author

I'll still keep this issue open for now, as it seems relevant to the Rust extension.

My first impression of rust-analyzer is that it tries to do too much; I prefer simplicity. But that's just my very first impression, I might give it a shot later.

@lnicola
Copy link
Member

lnicola commented Aug 1, 2021

You can disable most features, if that's what you mean, check out the manual or file an issue on that repo.

In a sense, it does less since it delegates formatting (to rustfmt) and most diagnostics (to cargo check).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants