From b46461a87296c7373f86739707bcae5572113220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Schr=C3=B6ter?= Date: Mon, 26 Jun 2023 18:03:50 +0200 Subject: [PATCH] fix(neovim): add workaround for omnisharp issues --- home/editors/neovim/lsp/lsp.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/home/editors/neovim/lsp/lsp.lua b/home/editors/neovim/lsp/lsp.lua index ae84f0d..55d4962 100644 --- a/home/editors/neovim/lsp/lsp.lua +++ b/home/editors/neovim/lsp/lsp.lua @@ -35,6 +35,18 @@ local on_attach = function(client, bufnr) end, }) end + + -- workaround for https://github.com/OmniSharp/omnisharp-roslyn/issues/2483 + if client.name == "omnisharp" then + local tokenModifiers = client.server_capabilities.semanticTokensProvider.legend.tokenModifiers + for i, v in ipairs(tokenModifiers) do + tokenModifiers[i] = string.gsub(v, "%s*[- ]%s*", "_") + end + local tokenTypes = client.server_capabilities.semanticTokensProvider.legend.tokenTypes + for i, v in ipairs(tokenTypes) do + tokenTypes[i] = string.gsub(v, "%s*[- ]%s*", "_") + end + end end local config = require("lspconfig")