summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/lsp/init.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua/lsp/init.lua')
-rw-r--r--.config/nvim/lua/lsp/init.lua18
1 files changed, 17 insertions, 1 deletions
diff --git a/.config/nvim/lua/lsp/init.lua b/.config/nvim/lua/lsp/init.lua
index f92ecd3..9cb3e78 100644
--- a/.config/nvim/lua/lsp/init.lua
+++ b/.config/nvim/lua/lsp/init.lua
@@ -150,6 +150,13 @@ function M.get_common_opts()
}
end
+local LSP_DEPRECATED_SIGN_MAP = {
+ ["LspDiagnosticsSignError"] = "DiagnosticSignError",
+ ["LspDiagnosticsSignWarning"] = "DiagnosticSignWarn",
+ ["LspDiagnosticsSignHint"] = "DiagnosticSignHint",
+ ["LspDiagnosticsSignInformation"] = "DiagnosticSignInfo",
+}
+
function M.setup()
Log:debug "Setting up LSP support"
@@ -158,7 +165,16 @@ function M.setup()
return
end
+ local is_neovim_nightly = vim.fn.has "nvim-0.5.1" > 0
+
for _, sign in ipairs(options.lsp.diagnostics.signs.values) do
+ local lsp_sign_name = LSP_DEPRECATED_SIGN_MAP[sign.name]
+ if is_neovim_nightly and lsp_sign_name then
+ vim.fn.sign_define(
+ lsp_sign_name,
+ { texthl = lsp_sign_name, text = sign.text, numhl = lsp_sign_name }
+ )
+ end
vim.fn.sign_define(
sign.name,
{ texthl = sign.name, text = sign.text, numhl = sign.name }
@@ -176,7 +192,7 @@ function M.setup()
require("lsp.null-ls").setup()
- require("utils").toggle_autoformat()
+ require("core.autocmds").configure_format_on_save()
end
return M