refactor(nvim): use builtin nightly lsp inlay hints
This commit is contained in:
parent
b1fedc6a65
commit
5ec1ddb4a0
@ -1,6 +1,5 @@
|
||||
local mason_lspconfig = require("mason-lspconfig")
|
||||
local lspconfig = require("lspconfig")
|
||||
local async = require("plenary.async")
|
||||
|
||||
-- NOTE: Keep this near top
|
||||
mason_lspconfig.setup({
|
||||
@ -12,6 +11,11 @@ local function on_attach(client, bufnr)
|
||||
vim.notify("Attached server " .. client.name, "info", {
|
||||
title = "LSP",
|
||||
})
|
||||
|
||||
-- Enable inlay hints if the language server provides them
|
||||
if client.server_capabilities.inlayHintProvider then
|
||||
vim.lsp.buf.inlay_hint(bufnr, true)
|
||||
end
|
||||
end
|
||||
|
||||
local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
|
@ -168,32 +168,6 @@ lazy.setup({
|
||||
end,
|
||||
},
|
||||
|
||||
-- Inlay hints for LSP
|
||||
{
|
||||
"lvimuser/lsp-inlayhints.nvim",
|
||||
branch = "anticonceal",
|
||||
config = function()
|
||||
require("lsp-inlayhints").setup({
|
||||
inlay_hints = {
|
||||
highlight = "LspInlayHint",
|
||||
},
|
||||
})
|
||||
vim.api.nvim_create_augroup("LspAttach_inlayhints", {})
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = "LspAttach_inlayhints",
|
||||
callback = function(args)
|
||||
if not (args.data and args.data.client_id) then
|
||||
return
|
||||
end
|
||||
|
||||
local bufnr = args.buf
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
require("lsp-inlayhints").on_attach(client, bufnr)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Show code actions
|
||||
{
|
||||
"kosayoda/nvim-lightbulb",
|
||||
|
Loading…
x
Reference in New Issue
Block a user