Readd omnisharp and disable roslyn

It isnt quite ready for prime time yet. diagnostics
arent getting handled.
This commit is contained in:
Jeremy Wall 2024-01-09 12:24:39 -05:00
parent fcb1d2420b
commit b9ad9eac83
3 changed files with 39 additions and 38 deletions

View File

@ -165,6 +165,7 @@ EOF";
nil-pkg
lua-language-server
rust-analyzer
omnisharp-roslyn
]);
};
};

View File

@ -138,45 +138,45 @@ lspconfig.nil_ls.setup {
capabilities = caps,
}
require('roslyn').setup({
on_attach = function (client, _)
--vim.notify(vim.inspect(client))
end,
capabilities = caps,
log_level = "Trace",
});
--require('roslyn').setup({
-- on_attach = function (client, _)
-- --vim.notify(vim.inspect(client))
-- end,
-- capabilities = caps,
-- log_level = "Trace",
--});
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 we need to massage it a bit.
-- on_attach = function(client, bufnr)
-- -- 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,
-- },
-- capabilities = caps,
--}
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 we need to massage it a bit.
on_attach = function(client, bufnr)
-- 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,
},
capabilities = caps,
}
--ocaml
lspconfig.ocamllsp.setup {

6
nix/darwin/flake.lock generated
View File

@ -37,12 +37,12 @@
},
"locked": {
"lastModified": 1,
"narHash": "sha256-LPZptn4TgP1Rk6u1FQauqeRdswDP5VxmhlE8AfFVRFE=",
"path": "/nix/store/89vbp2wn5hvs421h8c220jazqfcrbwf0-source/nix/base-system",
"narHash": "sha256-VDkul+Z32T3/AhU5fY7Wtaf7n6U3WOPFG63Z7lL2WjQ=",
"path": "/nix/store/ljim4cw8ldrl6azj7kwmy2fa0vgnhgm6-source/nix/base-system",
"type": "path"
},
"original": {
"path": "/nix/store/89vbp2wn5hvs421h8c220jazqfcrbwf0-source/nix/base-system",
"path": "/nix/store/ljim4cw8ldrl6azj7kwmy2fa0vgnhgm6-source/nix/base-system",
"type": "path"
}
},