Skip to content

Commit

Permalink
docs(rust): fix incorrect snippet for setting up different profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Jun 18, 2024
1 parent e4f5344 commit 59caac5
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lua/astrocommunity/pack/rust/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Rust Language Pack

This plugin pack does the following:

- Adds `rust` Treesitter parsers
Expand All @@ -20,21 +21,24 @@ Add this into your LSP configuration to make the rust-analyzer use its own profi
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:
The following can be added to the configuration of AstroLSP to customize the profiles used by rust-analyzer.

```
lsp = {
```lua
return {
"AstroNvim/astrolsp",
opts = {
config = {
rust_analyzer = {
settings = {
["rust-analyzer"] = {
cargo = {
extraEnv = { CARGO_PROFILE_RUST_ANALYZER_INHERITS = 'dev', },
extraArgs = { "--profile", "rust-analyzer", },
cargo = {
extraEnv = { CARGO_PROFILE_RUST_ANALYZER_INHERITS = "dev" },
extraArgs = { "--profile", "rust-analyzer" },
},
},
},
},
},
},
}
```

0 comments on commit 59caac5

Please sign in to comment.