rust-lang / rust-lang/rust-analyzer
add options and documentation for diagnostics
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
Some of my code has been untouched for quite some time, and thus, doesn't always follow the latest conventions, such as using short-hand struct initialization. I have a lot of code to maintain, and updating all of it to adhere to these conventions is very time consuming. This is generally why I avoid Clippy (among other reasons, like there being too many false positives), and also why I occasionally squash deprecation warnings.
It seems like rust-analyzer has its own lints that it provides, seemingly called "diagnostics" in the source code, but I cannot figure out how to disable them. In particular, I have some code that is not using shorthand struct initialization everywhere, so rust-analyzer warns at every such instance, which is quite annoying.
It took me quite some to figure out where this warning was coming from. At first, I thought rust-analyzer was somehow embedding Clippy. And then I thought perhaps the compiler was emitting this warning (strange as that might be) and that I had somehow squashed this warning in the normal cargo build workflow in a way that wasn't getting picked up by rust-analyzer.
It wasn't until I grepped the rust-analyzer source code that I realized it was the one responsible for the warning.
I was pretty surprised by this, and generally did not expect rust-analyzer to also be a linter. Is it intended for rust-analyzer to stand up its own linting strategies separate from Clippy?
It would be very nice to have some docs on this and also a way to turn it off. In particular, if I run cargo build in my terminal and that exits cleanly, then I generally expect rust-analyzer to be similarly clean.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating rust-analyzer's diagnostics in its source, especially the shorthand struct initialization warning mentioned in the report. Define the documentation and configuration behavior for disabling these diagnostics; done means users can understand their origin and turn them off when desired.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools, documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100