From b91c620b20019e0602b03f592a041cef22a33b12 Mon Sep 17 00:00:00 2001 From: ozpv <39195175+ozpv@users.noreply.github.com> Date: Wed, 25 Dec 2024 16:00:46 -0600 Subject: fix rust_analyzer error for now --- apps/nixvim.nix | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'apps/nixvim.nix') diff --git a/apps/nixvim.nix b/apps/nixvim.nix index 9440525..f5655bb 100644 --- a/apps/nixvim.nix +++ b/apps/nixvim.nix @@ -6,14 +6,23 @@ programs.nixvim = { enable = true; + # fix rust_analyzer error + extraConfigLua = "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"; + keymaps = [ - # Equivalent to nnoremap ; : { key = ";"; action = ":"; } - # Equivalent to nmap gg Man { key = "gg"; action = "Man"; @@ -22,22 +31,18 @@ remap = false; }; } - # Etc... ]; globals.mapleader = " "; clipboard.register = "unnamedplus"; - # We can also set options: opts = { tabstop = 4; shiftwidth = 4; expandtab = false; mouse = "a"; - - # etc... }; plugins = { @@ -62,7 +67,7 @@ lsp = { enable = true; servers = { - tsserver.enable = true; + ts_ls.enable = true; lua_ls.enable = true; bashls.enable = true; html.enable = true; -- cgit v1.2.3