diff --git a/nvim/init.lua b/nvim/init.lua index b469aa69..db41ad4b 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -54,6 +54,17 @@ vim.opt.rtp:prepend(lazypath) require("lazy").setup("plugins") +-- LSP Ignore error +for _, method in ipairs({ "textDocument/diagnostic", "workspace/diagnostic" }) do + local default_diagnostic_handler = vim.lsp.handlers[method] + vim.lsp.handlers[method] = function(err, result, context, config) + if err ~= nil and err.code == -32802 then + return + end + return default_diagnostic_handler(err, result, context, config) + end +end + -- Mappings -- Save -- diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua index f94d2fc8..b971126b 100644 --- a/nvim/lua/plugins/init.lua +++ b/nvim/lua/plugins/init.lua @@ -1,4 +1,20 @@ return { + { + "nvimtools/none-ls.nvim", + config = function() + local null_ls = require("null-ls") + + local formatting = null_ls.builtins.formatting + + local sources = { + formatting.ocamlformat, + } + + null_ls.setup({ + sources = sources, + }) + end, + }, { "akinsho/toggleterm.nvim", version = "*", config = true }, { "christoomey/vim-tmux-navigator", @@ -157,6 +173,10 @@ return { lsp.rust_analyzer.setup({ capabilities = capabilities, + diagnostic = { + -- Prevents the annoying popup for cancalled requests + refreshSupport = false, + }, }) lsp.gopls.setup({