diff --git a/dots/.config/nvim/lua/plugins/configs/lsp.lua b/dots/.config/nvim/lua/plugins/configs/lsp.lua index ad81f1d3..185b75fa 100755 --- a/dots/.config/nvim/lua/plugins/configs/lsp.lua +++ b/dots/.config/nvim/lua/plugins/configs/lsp.lua @@ -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()) diff --git a/dots/.config/nvim/lua/plugins/plugins.lua b/dots/.config/nvim/lua/plugins/plugins.lua index f72ec6fb..51511699 100755 --- a/dots/.config/nvim/lua/plugins/plugins.lua +++ b/dots/.config/nvim/lua/plugins/plugins.lua @@ -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",