mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
Merge #1755
1755: feat(docs): add coc-rust-analyzer r=JeanMertz a=fannheyward Co-authored-by: Heyward Fann <fannheyward@gmail.com>
This commit is contained in:
commit
e365236bfb
1 changed files with 4 additions and 27 deletions
|
@ -106,35 +106,12 @@ to load path and require it in `init.el`
|
||||||
- Note that if you use a plugin manager other than `vim-plug`, you may need to manually
|
- Note that if you use a plugin manager other than `vim-plug`, you may need to manually
|
||||||
checkout the `release` branch wherever your plugin manager cloned it. Otherwise you will
|
checkout the `release` branch wherever your plugin manager cloned it. Otherwise you will
|
||||||
get errors about a missing javascript file.
|
get errors about a missing javascript file.
|
||||||
* Add rust analyzer using: [coc.nvim wiki][coc-wiki]
|
* Run `:CocInstall coc-rust-analyzer` to install `coc-rust-analyzer`, this extension already implemented _almost_ all features supported in VSCode extension:
|
||||||
- Use `:CocConfig` in command mode to edit the config file.
|
- same configurations as VSCode extension, `rust-analyzer.raLspServerPath`, `rust-analyzer.enableCargoWatchOnStartup` etc.
|
||||||
|
- same commands too, `rust-analyzer.analyzerStatus`, `rust-analyzer.startCargoWatch` etc.
|
||||||
```jsonc
|
- highlighting and inlay_hints is not works by now
|
||||||
"languageserver": {
|
|
||||||
"rust": {
|
|
||||||
"command": "ra_lsp_server",
|
|
||||||
"filetypes": ["rust"],
|
|
||||||
"rootPatterns": ["Cargo.toml"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
For those not familiar with js, the whole file should be enclosed in `{` and `}`, with all of your config options in between. So for example, if rust-analyzer was your only language server, you could do the following:
|
|
||||||
|
|
||||||
```jsonc
|
|
||||||
{
|
|
||||||
"languageserver": {
|
|
||||||
"rust": {
|
|
||||||
"command": "ra_lsp_server",
|
|
||||||
"filetypes": ["rust"],
|
|
||||||
"rootPatterns": ["Cargo.toml"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
[coc.nvim]: https://github.com/neoclide/coc.nvim
|
[coc.nvim]: https://github.com/neoclide/coc.nvim
|
||||||
[coc-wiki]: https://github.com/neoclide/coc.nvim/wiki/Language-servers#rust
|
|
||||||
[coc-vim-conf]: https://github.com/neoclide/coc.nvim/#example-vim-configuration
|
[coc-vim-conf]: https://github.com/neoclide/coc.nvim/#example-vim-configuration
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue