feat(lsp): enable inlay hints by default on Neovim 0.10

This commit is contained in:
Folke Lemaitre 2024-05-16 21:20:24 +02:00
parent 2de7f24530
commit 960e958548

View file

@ -38,7 +38,7 @@ return {
-- Be aware that you also will need to properly configure your LSP server to
-- provide the inlay hints.
inlay_hints = {
enabled = false,
enabled = true,
},
-- Enable this to enable the builtin LSP code lenses on Neovim >= 0.10.0
-- Be aware that you also will need to properly configure your LSP server to
@ -140,6 +140,7 @@ return {
end
end
if vim.fn.has("nvim-0.10") == 1 then
-- inlay hints
if opts.inlay_hints.enabled then
LazyVim.lsp.on_attach(function(client, buffer)
@ -162,6 +163,7 @@ return {
end
end)
end
end
if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then
opts.diagnostics.virtual_text.prefix = vim.fn.has("nvim-0.10.0") == 0 and ""