Skip to content

Commit 2e221a8

Browse files
VlaDexakontr0x
authored andcommitted
Enable inlay hints for the supporting servers (nvim-lua#843)
1 parent d32368d commit 2e221a8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

init.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,16 @@ require('lazy').setup({
438438
callback = vim.lsp.buf.clear_references,
439439
})
440440
end
441+
442+
-- The following autocommand is used to enable inlay hints in your
443+
-- code, if the language server you are using supports them
444+
--
445+
-- This may be unwanted, since they displace some of your code
446+
if client and client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then
447+
map('<leader>th', function()
448+
vim.lsp.inlay_hint.enable(0, not vim.lsp.inlay_hint.is_enabled())
449+
end, '[T]oggle Inlay [H]ints')
450+
end
441451
end,
442452
})
443453

0 commit comments

Comments
 (0)