From 86ddcdb594a8ad22a53feb5da8e1edf10609d7d8 Mon Sep 17 00:00:00 2001 From: Christian Nieves Date: Fri, 23 Jun 2023 15:13:43 -0500 Subject: [PATCH] notify of all LSP errors --- vim/.vim/lua/config/lsp.lua | 34 ++++++++++++------------- vim/.vim/lua/config/nvim-treesitter.lua | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/vim/.vim/lua/config/lsp.lua b/vim/.vim/lua/config/lsp.lua index 0497712..5dfa4f5 100644 --- a/vim/.vim/lua/config/lsp.lua +++ b/vim/.vim/lua/config/lsp.lua @@ -187,6 +187,23 @@ local conditionalSources = { }, } +vim.lsp.handlers["window/showMessage"] = function(_, result, ctx) + local client = vim.lsp.get_client_by_id(ctx.client_id) + local lvl = ({ + "ERROR", + "WARN", + "INFO", + "DEBUG", + })[result.type] + notify({ result.message }, lvl, { + title = "LSP | " .. client.name, + timeout = 1000, + keep = function() + return lvl == "ERROR" or lvl == "WARN" + end, + }) +end + if use_google() then require("cmp_nvim_ciderlsp").setup() @@ -212,23 +229,6 @@ if use_google() then notify("ctx:" .. ctx, "info", { timeout = 900 }) end - cider_lsp_handlers["window/showMessage"] = function(_, result, ctx) - local client = vim.lsp.get_client_by_id(ctx.client_id) - local lvl = ({ - "ERROR", - "WARN", - "INFO", - "DEBUG", - })[result.type] - notify({ result.message }, lvl, { - title = "LSP | " .. client.name, - timeout = 1000, - keep = function() - return lvl == "ERROR" or lvl == "WARN" - end, - }) - end - capabilities = require("cmp_nvim_ciderlsp").update_capabilities(capabilities) capabilities.workspace.codeLens = { refreshSupport = true } capabilities.workspace.diagnostics = { refreshSupport = true } diff --git a/vim/.vim/lua/config/nvim-treesitter.lua b/vim/.vim/lua/config/nvim-treesitter.lua index 11d279e..b5a8b84 100644 --- a/vim/.vim/lua/config/nvim-treesitter.lua +++ b/vim/.vim/lua/config/nvim-treesitter.lua @@ -19,7 +19,7 @@ require("nvim-treesitter.configs").setup({ -- Using this option may slow down your editor, and you may see some duplicate highlights. -- Instead of true it can also be a list of languages -- additional_vim_regex_highlighting = true, - additional_vim_regex_highlighting = { "java" }, + -- additional_vim_regex_highlighting = { "java" }, }, -- rainbow = { -- enable = true,