diff options
-rw-r--r-- | docs/user/manual.adoc | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc index 990b11859..10d4fd606 100644 --- a/docs/user/manual.adoc +++ b/docs/user/manual.adoc | |||
@@ -272,7 +272,40 @@ let g:ale_linters = {'rust': ['analyzer']} | |||
272 | 272 | ||
273 | NeoVim 0.5 (not yet released) has built-in language server support. | 273 | NeoVim 0.5 (not yet released) has built-in language server support. |
274 | For a quick start configuration of rust-analyzer, use https://github.com/neovim/nvim-lspconfig#rust_analyzer[neovim/nvim-lspconfig]. | 274 | For a quick start configuration of rust-analyzer, use https://github.com/neovim/nvim-lspconfig#rust_analyzer[neovim/nvim-lspconfig]. |
275 | Once `neovim/nvim-lspconfig` is installed, use `+lua require'nvim_lsp'.rust_analyzer.setup({})+` in your `init.vim`. | 275 | Once `neovim/nvim-lspconfig` is installed, use `+lua require'lspconfig'.rust_analyzer.setup({})+` in your `init.vim`. |
276 | |||
277 | You can also pass LSP settings to the server: | ||
278 | |||
279 | [source,vim] | ||
280 | ---- | ||
281 | lua << EOF | ||
282 | local nvim_lsp = require'lspconfig' | ||
283 | |||
284 | local on_attach = function(client) | ||
285 | require'completion'.on_attach(client) | ||
286 | end | ||
287 | |||
288 | nvim_lsp.rust_analyzer.setup({ | ||
289 | on_attach=on_attach, | ||
290 | settings = { | ||
291 | ["rust-analyzer"] = { | ||
292 | assist = { | ||
293 | importMergeBehavior = "last", | ||
294 | importPrefix = "by_self", | ||
295 | }, | ||
296 | cargo = { | ||
297 | loadOutDirsFromCheck = true | ||
298 | }, | ||
299 | procMacro = { | ||
300 | enable = true | ||
301 | }, | ||
302 | } | ||
303 | } | ||
304 | }) | ||
305 | EOF | ||
306 | ---- | ||
307 | |||
308 | See https://sharksforarms.dev/posts/neovim-rust/ for more tips on getting started. | ||
276 | 309 | ||
277 | === Sublime Text 3 | 310 | === Sublime Text 3 |
278 | 311 | ||