diff --git a/nix/base-system/flake.nix b/nix/base-system/flake.nix index b9534c2..c10a191 100644 --- a/nix/base-system/flake.nix +++ b/nix/base-system/flake.nix @@ -38,7 +38,6 @@ "tree-sitter-toml" "tree-sitter-yaml" "tree-sitter-json" - #"tree-sitter-ini" "tree-sitter-html" "tree-sitter-css" "tree-sitter-nix" diff --git a/nix/base-system/init.lua b/nix/base-system/init.lua index 39e101b..64e86d3 100644 --- a/nix/base-system/init.lua +++ b/nix/base-system/init.lua @@ -64,14 +64,26 @@ local vim_pid = vim.fn.getpid() -- "FormatterOptions:EnableEditorConfigSupport=true" local omnisharp_cmd = { 'omnisharp', '--languageserver', '-v', '--hostPID', tostring(vim_pid), } +local function toSnakeCase(str) + return string.gsub(str, "%s*[- ]%s*", "_") +end + lspconfig.omnisharp.setup { cmd = omnisharp_cmd, enable_roslyn_analyzers = true, enable_editorconfig_support = true, enable_import_completion = true, - -- Omnisharp has issues with the semanticTokens feature. disable it for this language server. + -- Omnisharp has issues with the semanticTokens feature we need to massage it a bit. on_attach = function(client, bufnr) - client.server_capabilities.semanticTokensProvider = nil + -- https://github.com/OmniSharp/omnisharp-roslyn/issues/2483#issuecomment-1492605642 + local tokenModifiers = client.server_capabilities.semanticTokensProvider.legend.tokenModifiers + for i, v in ipairs(tokenModifiers) do + tokenModifiers[i] = toSnakeCase(v) + end + local tokenTypes = client.server_capabilities.semanticTokensProvider.legend.tokenTypes + for i, v in ipairs(tokenTypes) do + tokenTypes[i] = toSnakeCase(v) + end end, handlers = { ["textDocument/definition"] = require('omnisharp_extended').handler, @@ -187,21 +199,21 @@ require('nvim-treesitter.configs').setup { extended_mode = true, max_file_lines = nil, }, - textobjects = { - select = { - enable = true, - lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ['aa'] = '@parameter.outer', - ['ia'] = '@parameter.inner', - ['af'] = '@function.outer', - ['if'] = '@function.inner', - ['ac'] = '@class.outer', - ['ic'] = '@class.inner', - }, - }, - }, + --textobjects = { + -- select = { + -- enable = true, + -- lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim + -- keymaps = { + -- -- You can use the capture groups defined in textobjects.scm + -- ['aa'] = '@parameter.outer', + -- ['ia'] = '@parameter.inner', + -- ['af'] = '@function.outer', + -- ['if'] = '@function.inner', + -- ['ac'] = '@class.outer', + -- ['ic'] = '@class.inner', + -- }, + -- }, + --}, --incremental_selection = { -- enable = true, -- keymaps = { diff --git a/nix/darwin/flake.lock b/nix/darwin/flake.lock index 8e86388..d88a1ea 100644 --- a/nix/darwin/flake.lock +++ b/nix/darwin/flake.lock @@ -34,12 +34,12 @@ }, "locked": { "lastModified": 1, - "narHash": "sha256-LdDXr6idLkkTeHwlq0ZA7kri4HMr124xABHowvooD/c=", - "path": "/nix/store/hhwybysgssx8f4ivff8yhagm6iyqgis9-source/nix/base-system", + "narHash": "sha256-RQLwfX1ZM8lLATzqM41ZhBnB+LRK71D3Q5nyaG3c30A=", + "path": "/nix/store/3yf62sm1x6h8bb01hxwln2sgi1czwcqy-source/nix/base-system", "type": "path" }, "original": { - "path": "/nix/store/hhwybysgssx8f4ivff8yhagm6iyqgis9-source/nix/base-system", + "path": "/nix/store/3yf62sm1x6h8bb01hxwln2sgi1czwcqy-source/nix/base-system", "type": "path" } },