This repository was archived by the owner on May 28, 2025. It is now read-only.
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:
337337[source,vim]
338338----
339339lua << EOF
340- local nvim_lsp = require'lspconfig'
340+ local lspconfig = require'lspconfig'
341341
342342local on_attach = function(client)
343343 require'completion'.on_attach(client)
344344end
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({
367367EOF
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+
370381See https://sharksforarms.dev/posts/neovim-rust/ for more tips on getting started.
371382
372383Check 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