astronvim-config/lsp/on_attach.lua

10 lines
358 B
Lua
Raw Normal View History

2023-02-23 23:25:59 +01:00
return function(client, bufnr)
if client.server_capabilities.inlayHintProvider then
local inlayhints_avail, inlayhints = pcall(require, "lsp-inlayhints")
if inlayhints_avail then
inlayhints.on_attach(client, bufnr)
vim.keymap.set("n", "<leader>uH", function() inlayhints.toggle() end, { desc = "Toggle inlay hints" })
end
end
end