updated lspconfig for some deprecated stuff
This commit is contained in:
@@ -54,10 +54,14 @@ return {
|
||||
keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts) -- show diagnostics for line
|
||||
|
||||
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"
|
||||
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"
|
||||
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)
|
||||
-- (not in youtube nvim video)
|
||||
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
|
||||
local x = vim.diagnostic.severity
|
||||
vim.diagnostic.config({
|
||||
virtual_text = { prefix = "" },
|
||||
signs = { text = { [x.ERROR] = "", [x.WARN] = "", [x.INFO] = "", [x.HINT] = "" } },
|
||||
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({
|
||||
-- default handler for installed servers
|
||||
@@ -111,7 +123,16 @@ return {
|
||||
-- configure emmet language server
|
||||
lspconfig["emmet_ls"].setup({
|
||||
capabilities = capabilities,
|
||||
filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" },
|
||||
filetypes = {
|
||||
"html",
|
||||
"typescriptreact",
|
||||
"javascriptreact",
|
||||
"css",
|
||||
"sass",
|
||||
"scss",
|
||||
"less",
|
||||
"svelte",
|
||||
},
|
||||
})
|
||||
end,
|
||||
["lua_ls"] = function()
|
||||
|
||||
Reference in New Issue
Block a user