mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-28 03:30:12 +02:00
feat(lsp): enable inlay hints by default on Neovim 0.10
This commit is contained in:
parent
2de7f24530
commit
960e958548
1 changed files with 23 additions and 21 deletions
|
@ -38,7 +38,7 @@ return {
|
||||||
-- Be aware that you also will need to properly configure your LSP server to
|
-- Be aware that you also will need to properly configure your LSP server to
|
||||||
-- provide the inlay hints.
|
-- provide the inlay hints.
|
||||||
inlay_hints = {
|
inlay_hints = {
|
||||||
enabled = false,
|
enabled = true,
|
||||||
},
|
},
|
||||||
-- Enable this to enable the builtin LSP code lenses on Neovim >= 0.10.0
|
-- 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
|
-- Be aware that you also will need to properly configure your LSP server to
|
||||||
|
@ -140,27 +140,29 @@ return {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- inlay hints
|
if vim.fn.has("nvim-0.10") == 1 then
|
||||||
if opts.inlay_hints.enabled then
|
-- inlay hints
|
||||||
LazyVim.lsp.on_attach(function(client, buffer)
|
if opts.inlay_hints.enabled then
|
||||||
if client.supports_method("textDocument/inlayHint") then
|
LazyVim.lsp.on_attach(function(client, buffer)
|
||||||
LazyVim.toggle.inlay_hints(buffer, true)
|
if client.supports_method("textDocument/inlayHint") then
|
||||||
end
|
LazyVim.toggle.inlay_hints(buffer, true)
|
||||||
end)
|
end
|
||||||
end
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
-- code lens
|
-- code lens
|
||||||
if opts.codelens.enabled and vim.lsp.codelens then
|
if opts.codelens.enabled and vim.lsp.codelens then
|
||||||
LazyVim.lsp.on_attach(function(client, buffer)
|
LazyVim.lsp.on_attach(function(client, buffer)
|
||||||
if client.supports_method("textDocument/codeLens") then
|
if client.supports_method("textDocument/codeLens") then
|
||||||
vim.lsp.codelens.refresh()
|
vim.lsp.codelens.refresh()
|
||||||
--- autocmd BufEnter,CursorHold,InsertLeave <buffer> lua vim.lsp.codelens.refresh()
|
--- autocmd BufEnter,CursorHold,InsertLeave <buffer> lua vim.lsp.codelens.refresh()
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave" }, {
|
vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave" }, {
|
||||||
buffer = buffer,
|
buffer = buffer,
|
||||||
callback = vim.lsp.codelens.refresh,
|
callback = vim.lsp.codelens.refresh,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then
|
if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue