Skip to content

Commit

Permalink
feat(lsp): add <leader>uH toggle for lsp-inlayhints (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed May 24, 2023
1 parent 2ad51c8 commit dfa7e90
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lua/astrocommunity/lsp/lsp-inlayhints-nvim/lsp-inlayhints.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ return {
callback = function(args)
if not (args.data and args.data.client_id) then return end
local client = vim.lsp.get_client_by_id(args.data.client_id)
if client.server_capabilities.inlayHintProvider then require("lsp-inlayhints").on_attach(client, args.buf) end
if client.server_capabilities.inlayHintProvider then
local inlayhints = require "lsp-inlayhints"
inlayhints.on_attach(client, args.buf)
require("astronvim.utils").set_mappings({
n = {
["<leader>uH"] = { inlayhints.toggle, desc = "Toggle inlay hints" },
},
}, { buffer = args.buf })
end
end,
})
end,
Expand Down

0 comments on commit dfa7e90

Please sign in to comment.