Skip to content

Commit

Permalink
docs(pack): Add section for possible LSP tweaks to Rust (#329)
Browse files Browse the repository at this point in the history
Co-authored-by: Uzair Aftab <[email protected]>
  • Loading branch information
hunger and Uzaaft authored Jun 29, 2023
1 parent 435acc3 commit ec73eb8
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions lua/astrocommunity/pack/rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,33 @@ This plugin pack does the following:
- Adds [rust-tools.nvim](https://github.com/simrat39/rust-tools.nvim) for language specific tooling
- Adds [crates.nvim](https://github.com/Saecki/crates.nvim) for crate management
- Adds [TOML language support](../toml)

## Additional LSP Configuration Tweaks

Configuring the LSP is out of scope for community packs, but here are some interesting things you
may want to do:

### Make Rust-Analyzer use its own profile

Add this into your LSP configuration to make the rust-analyzer use its own profile. The effect is
that you will use more disk space as rust-analyzer gets its own special folder in `targets`. The
upside is that you can run `cargo build` without that being blocked while rust-analyzer runs.

The first three levels of this are AstronVim-specific configurations, the rest is rust-analyzer specific:

```
lsp = {
config = {
rust_analyzer = {
settings = {
["rust-analyzer"] = {
cargo = {
extraEnv = { CARGO_PROFILE_RUST_ANALYZER_INHERITS = 'dev', },
extraArgs = { "--profile", "rust-analyzer", },
},
},
},
},
},
},
```

0 comments on commit ec73eb8

Please sign in to comment.