feat(nvim): add lsp inlay hints
This commit is contained in:
parent
1566dc84f4
commit
d6b95fdef6
1 changed files with 14 additions and 2 deletions
|
@ -54,7 +54,7 @@ capabilities.textDocument.foldingRange = {
|
|||
require("ufo").setup()
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
local on_attach_def = function(_, bufnr)
|
||||
local on_attach_def = function(client, bufnr)
|
||||
require("which-key").register({
|
||||
K = { vim.lsp.buf.hover, "Hover" },
|
||||
["<leader>"] = {
|
||||
|
@ -71,7 +71,13 @@ local on_attach_def = function(_, bufnr)
|
|||
},
|
||||
},
|
||||
t = {
|
||||
l = { lsp_lines.toggle, "Lsp lines" },
|
||||
l = { lsp_lines.toggle, "LSP lines" },
|
||||
i = {
|
||||
function()
|
||||
vim.lsp.inlay_hint(bufnr, nil)
|
||||
end,
|
||||
"LSP inlay hints",
|
||||
},
|
||||
},
|
||||
},
|
||||
g = {
|
||||
|
@ -99,6 +105,12 @@ local on_attach_def = function(_, bufnr)
|
|||
d = { vim.diagnostic.goto_next, "Next diagnostic" },
|
||||
},
|
||||
}, { buffer = bufnr, silent = true })
|
||||
|
||||
if client.server_capabilities.inlayHintProvider then
|
||||
vim.defer_fn(function()
|
||||
vim.lsp.inlay_hint(bufnr, true)
|
||||
end, 1000)
|
||||
end
|
||||
end
|
||||
|
||||
local lspconfig_default_options = {
|
||||
|
|
Loading…
Reference in a new issue