Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit ea837d1

Browse files
committed
Document nvim 0.10 inlay_hint
1 parent 4a8d0f7 commit ea837d1

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

docs/user/manual.adoc

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,14 +337,14 @@ You can also pass LSP settings to the server:
337337
[source,vim]
338338
----
339339
lua << EOF
340-
local nvim_lsp = require'lspconfig'
340+
local lspconfig = require'lspconfig'
341341
342342
local on_attach = function(client)
343343
require'completion'.on_attach(client)
344344
end
345345
346-
nvim_lsp.rust_analyzer.setup({
347-
on_attach=on_attach,
346+
lspconfig.rust_analyzer.setup({
347+
on_attach = on_attach,
348348
settings = {
349349
["rust-analyzer"] = {
350350
imports = {
@@ -367,6 +367,17 @@ nvim_lsp.rust_analyzer.setup({
367367
EOF
368368
----
369369

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+
370381
See https://sharksforarms.dev/posts/neovim-rust/ for more tips on getting started.
371382

372383
Check out https://github.com/mrcjkb/rustaceanvim for a batteries included rust-analyzer setup for Neovim.

0 commit comments

Comments
 (0)