rust-lang / rust-lang/rust-analyzer
Running the main function or tests from VSCode extension causes the linting within the editor to change
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
When I use the "Run" action on the main function or the "Run Tests" or "Run Test" actions on tests, the linting of the resulting code file changes. Specifically, I see the following effects:
- Unused code is no longer greyed out
- I have set the
rust-analyzer.diagnostics.warningsAsHintoption to not highlight unused code. This option does not seem to work in this context and I get yellow underlines under unused variables again.
Saving a file returns linting to normal.
I would expect none of these actions to affect linting within the editor, similar to running directly from the command line.
rust-analyzer version: 0.3.3049-standalone
rustc version: 1.98.1
editor or extension: VSCode
OS: Windows 11
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
Reproduce the issue in the VSCode extension using the Run, Run Tests, and Run Test actions, with rust-analyzer.diagnostics.warningsAsHint configured. Compare editor diagnostics before and after each action, then save the file to confirm the reset; done means these actions no longer alter linting or warning presentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100