From d83caa0c6a0512f027a2072c944a9fd7c6997130 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Sun, 4 Sep 2022 01:18:26 -0500 Subject: [PATCH] feat(nvim): support C# decompilation --- .../config/lua/plugins/configs/lsp.lua | 24 ++++++++++++++++--- .../primary/config/lua/plugins/plugins.lua | 1 + dots/.omnisharp/omnisharp.json | 5 ++++ 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 dots/.omnisharp/omnisharp.json diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/lsp.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/lsp.lua index 866b3646..1d7caae7 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/lsp.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/lsp.lua @@ -239,10 +239,28 @@ lspconfig.yamlls.setup({ on_attach = on_attach, }) -lspconfig.csharp_ls.setup({ - handlers = { - ["textDocument/definition"] = require("csharpls_extended").handler, +-- lspconfig.csharp_ls.setup({ +-- handlers = { +-- ["textDocument/definition"] = require("csharpls_extended").handler, +-- }, +-- capabilities = lsp_capabilities, +-- on_attach = on_attach, +-- }) + +lspconfig.omnisharp.setup({ + cmd = { + os.getenv("HOME") .. ".local/share/nvim/mason/bin/omnisharp", + "--languageserver", + "--hostPID", + tostring(vim.fn.getpid()), }, + + handlers = { + ["textDocument/definition"] = require("omnisharp_extended").handler, + }, + enable_import_completion = true, + enable_roslyn_analyzers = true, + organize_imports_on_format = true, capabilities = lsp_capabilities, on_attach = on_attach, }) diff --git a/dots/.nvim-environments/primary/config/lua/plugins/plugins.lua b/dots/.nvim-environments/primary/config/lua/plugins/plugins.lua index 38d7acc7..6de29abb 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/plugins.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/plugins.lua @@ -271,6 +271,7 @@ return packer.startup({ "nanotee/sqls.nvim", "williamboman/mason.nvim", "simrat39/rust-tools.nvim", + "Hoffs/omnisharp-extended-lsp.nvim", }, config = function() require("mason").setup({}) diff --git a/dots/.omnisharp/omnisharp.json b/dots/.omnisharp/omnisharp.json new file mode 100644 index 00000000..93920b23 --- /dev/null +++ b/dots/.omnisharp/omnisharp.json @@ -0,0 +1,5 @@ +{ + "RoslynExtensionsOptions": { + "enableDecompilationSupport": true + } +}