Skip to content

Commit b41cbdf

Browse files
committed
docs(dev-guide/linting): improve wording
1 parent fae9a26 commit b41cbdf

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

doc/dev-guide/src/linting.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,21 @@ $ cargo clippy --all --all-targets --all-features -- -D warnings
1414

1515
## Rust-Analyzer
1616

17-
When using [`rust-analyzer`](https://rust-analyzer.github.io/) integration in the IDE of your choice, you might want to set the `rust-analyzer.cargo.features` configuration to `"all"` (check the [`rust-analyzer` manual](https://rust-analyzer.github.io/manual.html#configuration) for more details).
17+
When using [`rust-analyzer`](https://rust-analyzer.github.io/)'s clippy integration in the IDE of your choice, apart from setting the `rust-analyzer.check.command` property to `"clippy"`, you might also want to set the `rust-analyzer.cargo.features` property to `"all"` (check the [`rust-analyzer` manual](https://rust-analyzer.github.io/manual.html#configuration) for more details).
1818

1919
### VSCode/VSCodium setup
2020

21-
Add
21+
In your project's `.vscode/settings.json`[^vscode-global-cfg], add the following:
2222

23-
```json
24-
"rust-analyzer.cargo.features": "all":,
23+
```jsonc
24+
"rust-analyzer.check.command": "clippy",
25+
"rust-analyzer.cargo.features": "all",
2526
```
2627

27-
in your project at `.vscode/settings.json`
28+
[^vscode-global-cfg]:
29+
Alternatively, if you want to apply the configuration to all your Rust projects,
30+
you can add it to your global configuration at `~/.config/Code/User/settings.json` instead.
2831

29-
or
30-
31-
to your global configuration `~/.config/Code/User/settings.json` (although you need to be aware that this will apply to all your Rust projects).
32-
33-
34-
## Rationale
35-
36-
`rustup` uses cargo [features](https://doc.rust-lang.org/cargo/reference/features.html) in order to setup [conditional compilation](https://doc.rust-lang.org/reference/conditional-compilation.html) for integration tests as the `#[cfg(test)]` is only available for unit tests. To this end, the `test` feature has been created, however it then needs to be activated in order for tests and linting to fully work. As a shortcut we then propose to activate all features. However, if you encounter an issue, you could try activating only the `test` feature by setting the `rust-analyzer.cargo.features` configuration to `["test"]`.
32+
### Rationale
3733

34+
`rustup` uses cargo [features](https://doc.rust-lang.org/cargo/reference/features.html) in order to setup [conditional compilation](https://doc.rust-lang.org/reference/conditional-compilation.html) for integration tests as the `#[cfg(test)]` is only available for unit tests. To this end, the `test` feature has been created, however it then needs to be activated in order for linting to fully work. As a shortcut we then propose to activate all features. However, if you encounter an issue, you could try activating only the `test` feature by setting the `rust-analyzer.cargo.features` configuration to `["test"]`.

0 commit comments

Comments
 (0)