Skip to content

Commit

Permalink
chore(pack): Document rust-analyzer.check.command behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
boraarslan committed Jul 16, 2024
1 parent 74c2d55 commit 26ec058
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion lua/astrocommunity/pack/rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This plugin pack does the following:
- Adds [TOML language support](../toml)

> [!NOTE]
> This pack DOES not add `rust_analyzer`. This should be managed by rustup. To add it to rustup, run: `rustup component add rust-analyzer`
> This pack DOES not add `rust_analyzer`. This should be managed by rustup. To add it to rustup, run: `rustup component add rust-analyzer`
## Additional LSP Configuration Tweaks

Expand Down Expand Up @@ -42,3 +42,31 @@ return {
},
}
```

## Use `cargo check` for `rust-analyzer.check.command`

By default, this pack configures `rust-analyzer.check.command` to use `cargo clippy` instead of `cargo check`.

In some cases (for example, on large projects where `cargo clippy` is slow), you may want to use `cargo check` instead.

There is currently no way to configure `rust-analyzer` per project, [adding `rust-analyzer.toml` support is still in progress](https://github.com/rust-lang/rust-analyzer/issues/13529).
If you want to use `cargo check` you can change the `rust-analyzer.check.command` globally like the following:

```lua
{
"AstroNvim/astrolsp",
opts = {
config = {
rust_analyzer = {
settings = {
["rust-analyzer"] = {
check = {
command = "check",
},
},
}
},
},
},
}
```

0 comments on commit 26ec058

Please sign in to comment.