diff --git a/lua/core/settings.lua b/lua/core/settings.lua index a1250fd0e..d6c30da8a 100644 --- a/lua/core/settings.lua +++ b/lua/core/settings.lua @@ -90,4 +90,8 @@ settings["null_ls_deps"] = { "vint", } +-- Set the inline_diagnostic_virtual_text to false if they are annoying for you +---@type boolean +settings["inline_diagnostic_virtual_text"] = true + return settings diff --git a/lua/modules/configs/completion/lsp.lua b/lua/modules/configs/completion/lsp.lua index 4fa02a7b0..d3bc425dc 100644 --- a/lua/modules/configs/completion/lsp.lua +++ b/lua/modules/configs/completion/lsp.lua @@ -37,6 +37,14 @@ return function() local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities) + vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { + signs = true, + underline = true, + virtual_text = require("core.settings").inline_diagnostic_virtual_text, + -- set update_in_insert to false bacause it was enabled by lspsaga + update_in_insert = false, + }) + local opts = { on_attach = function() require("lsp_signature").on_attach({