Skip to content

Commit ec5cc67

Browse files
committed
Enable inlay hints toggle for the supporting servers
1 parent 2377390 commit ec5cc67

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
@@ -518,6 +518,16 @@ require('lazy').setup({
518518
callback = vim.lsp.buf.clear_references,
519519
})
520520
end
521+
522+
-- The following autocommand is used to enable inlay hints in your
523+
-- code, if the language server you are using supports them
524+
--
525+
-- This may be unwanted, since they displace some of your code
526+
if client and client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then
527+
map('<leader>ci', function()
528+
vim.lsp.inlay_hint.enable(0, not vim.lsp.inlay_hint.is_enabled())
529+
end, 'Toggle [I]nlay hints')
530+
end
521531
end,
522532
})
523533

0 commit comments

Comments
 (0)