@@ -57,16 +57,14 @@ in your `.vscode/settings.json` file. This will ask `rust-analyzer` to use
57
57
` ./x.py check ` to check the sources, and the stage 0 rustfmt to format them.
58
58
59
59
60
- For Neovim users there are several options for configuring for rustc. You can use the native LSP
61
- server and make your own logic for changing the rust-analyzer configuration to the above. You can
62
- also use [ nlsp-settings] ( https://github.com/tamago324/nlsp-settings.nvim ) , which allows for
63
- project-local configuration files. This plugin allows for the above JSON to be directly put in to
64
- a file located at ` rust/.nlsp-settings/rust_analyzer.json ` . If you use
65
- [ coc-rust-analyzer] ( https://github.com/fannheyward/coc-rust-analyzer ) you can also use the above
66
- JSON, but placed in ` rust/.vim/coc-settings.json ` .
60
+ For Neovim users there are several options for configuring for rustc. The easiest way is by using
61
+ [ nlsp-settings] ( https://github.com/tamago324/nlsp-settings.nvim ) , which allows for project-local
62
+ configuration files with the native LSP. First install the plugin by however you manage your
63
+ plugins. Then run ` :LspSettings local rust_analyzer ` to create a JSON configuration file. Then
64
+ just paste the above JSON in.
67
65
68
- Below is the Lua needed to configure the native Neovim LSP the same as the above VSCode
69
- configuration
66
+ Another way is without a plugin, and creating your own logic in your configuration. The required
67
+ Lua for doing so is below.
70
68
71
69
``` lua
72
70
{
@@ -101,15 +99,15 @@ configuration
101
99
}
102
100
```
103
101
104
- If you have enough free disk space and you would like to be able to run ` x.py ` commands while
105
- rust-analyzer runs in the background, you can also add ` --build-dir build-rust-analyzer ` to the
106
- ` overrideCommand ` to avoid x.py locking.
107
-
108
102
If you're running ` coc.nvim ` , you can use ` :CocLocalConfig ` to create a
109
103
` .vim/coc-settings.json ` and enter the same settings as above, but replacing
110
104
` editor.formatOnSave: true, ` with
111
105
` "coc.preferences.formatOnSaveFiletypes": ["rust"], ` .
112
106
107
+ If you have enough free disk space and you would like to be able to run ` x.py ` commands while
108
+ rust-analyzer runs in the background, you can also add ` --build-dir build-rust-analyzer ` to the
109
+ ` overrideCommand ` to avoid x.py locking.
110
+
113
111
If running ` ./x.py check ` on save is inconvenient, in VS Code you can use a [ Build
114
112
Task] instead:
115
113
0 commit comments