File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -337,14 +337,14 @@ You can also pass LSP settings to the server:
337
337
[source,vim]
338
338
----
339
339
lua << EOF
340
- local nvim_lsp = require'lspconfig'
340
+ local lspconfig = require'lspconfig'
341
341
342
342
local on_attach = function(client)
343
343
require'completion'.on_attach(client)
344
344
end
345
345
346
- nvim_lsp .rust_analyzer.setup({
347
- on_attach= on_attach,
346
+ lspconfig .rust_analyzer.setup({
347
+ on_attach = on_attach,
348
348
settings = {
349
349
["rust-analyzer"] = {
350
350
imports = {
@@ -367,6 +367,17 @@ nvim_lsp.rust_analyzer.setup({
367
367
EOF
368
368
----
369
369
370
+ If you're running Neovim 0.10 or later, you can enable inlay hints via `on_attach`:
371
+
372
+ [source,vim]
373
+ ----
374
+ lspconfig.rust_analyzer.setup({
375
+ on_attach = function(client, bufnr)
376
+ vim.lsp.inlay_hint.enable(bufnr)
377
+ end
378
+ })
379
+ ----
380
+
370
381
See https://sharksforarms.dev/posts/neovim-rust/ for more tips on getting started.
371
382
372
383
Check out https://github.com/mrcjkb/rustaceanvim for a batteries included rust-analyzer setup for Neovim.
You can’t perform that action at this time.
0 commit comments