updated lspconfig for some deprecated stuff

This commit is contained in:
2025-04-20 22:40:16 +02:00
parent 64d7be1514
commit 19f3694dab

View File

@@ -54,10 +54,14 @@ return {
keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts) -- show diagnostics for line keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts) -- show diagnostics for line
opts.desc = "Go to previous diagnostic" opts.desc = "Go to previous diagnostic"
keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) -- jump to previous diagnostic in buffer keymap.set("n", "[d", function()
vim.diagnostic.jump({ count = -1, float = true })
end, opts) -- jump to previous diagnostic in buffer
opts.desc = "Go to next diagnostic" opts.desc = "Go to next diagnostic"
keymap.set("n", "]d", vim.diagnostic.goto_next, opts) -- jump to next diagnostic in buffer keymap.set("n", "]d", function()
vim.diagnostic.jump({ count = 1, float = true })
end, opts) -- jump to next diagnostic in buffer
opts.desc = "Show documentation for what is under cursor" opts.desc = "Show documentation for what is under cursor"
keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor
@@ -72,11 +76,19 @@ return {
-- Change the Diagnostic symbols in the sign column (gutter) -- Change the Diagnostic symbols in the sign column (gutter)
-- (not in youtube nvim video) -- (not in youtube nvim video)
local signs = { Error = "", Warn = "", Hint = "󰠠 ", Info = "" } local x = vim.diagnostic.severity
for type, icon in pairs(signs) do vim.diagnostic.config({
local hl = "DiagnosticSign" .. type virtual_text = { prefix = "" },
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) signs = { text = { [x.ERROR] = "", [x.WARN] = "", [x.INFO] = "󰋼", [x.HINT] = "󰌵" } },
end underline = true,
float = { border = "single" },
})
-- local signs = { Error = " ", Warn = " ", Hint = "󰠠 ", Info = " " }
-- for type, icon in pairs(signs) do
-- local hl = "DiagnosticSign" .. type
-- vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
-- end
mason_lspconfig.setup_handlers({ mason_lspconfig.setup_handlers({
-- default handler for installed servers -- default handler for installed servers
@@ -111,7 +123,16 @@ return {
-- configure emmet language server -- configure emmet language server
lspconfig["emmet_ls"].setup({ lspconfig["emmet_ls"].setup({
capabilities = capabilities, capabilities = capabilities,
filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" }, filetypes = {
"html",
"typescriptreact",
"javascriptreact",
"css",
"sass",
"scss",
"less",
"svelte",
},
}) })
end, end,
["lua_ls"] = function() ["lua_ls"] = function()