Skip to content

Commit

Permalink
Enable inlay hints for the supporting servers (nvim-lua#843)
Browse files Browse the repository at this point in the history
  • Loading branch information
VlaDexa authored and halyD committed Jul 8, 2024
1 parent 11f87c3 commit 5ac014d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ require('lazy').setup({
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' },
}
end,
},
Expand Down Expand Up @@ -547,6 +548,16 @@ require('lazy').setup({
callback = vim.lsp.buf.clear_references,
})
end

-- The following autocommand is used to enable inlay hints in your
-- code, if the language server you are using supports them
--
-- This may be unwanted, since they displace some of your code
if client and client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then
map('<leader>th', function()
vim.lsp.inlay_hint.enable(0, not vim.lsp.inlay_hint.is_enabled())
end, '[T]oggle Inlay [H]ints')
end
end,
})

Expand Down

0 comments on commit 5ac014d

Please sign in to comment.