diff options
author | crupest <crupest@outlook.com> | 2024-01-28 00:49:45 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2024-01-28 00:49:45 +0800 |
commit | ab5092888aa8208286d835e813c55c9f995356c6 (patch) | |
tree | c9f3a9f0156432cdc75d28e32300140749d042e9 | |
parent | c5feef8de37bdfbdff582a678c13c2db954e2a74 (diff) | |
download | crupest-ab5092888aa8208286d835e813c55c9f995356c6.tar.gz crupest-ab5092888aa8208286d835e813c55c9f995356c6.tar.bz2 crupest-ab5092888aa8208286d835e813c55c9f995356c6.zip |
config(nvim): use csharp-ls as C# lsp and update plugins.
-rw-r--r-- | configs/nvim/lazy-lock.json | 28 | ||||
-rw-r--r-- | configs/nvim/lua/crupest/nvim/lsp/csharp.lua | 66 |
2 files changed, 18 insertions, 76 deletions
diff --git a/configs/nvim/lazy-lock.json b/configs/nvim/lazy-lock.json index e2e2c42..b4ad6f4 100644 --- a/configs/nvim/lazy-lock.json +++ b/configs/nvim/lazy-lock.json @@ -1,25 +1,25 @@ { "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, - "LuaSnip": { "branch": "master", "commit": "07f5d974203a5d957e7b464020261a657f59556d" }, + "LuaSnip": { "branch": "master", "commit": "2dbef19461198630b3d7c39f414d09fb07d1fdd2" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "everforest": { "branch": "master", "commit": "72f101bd63228a1a45012325e39c5280ec22c828" }, + "everforest": { "branch": "master", "commit": "89080db9637bb297b4c75ae1511e9f6f61ad9c78" }, "formatter.nvim": { "branch": "master", "commit": "cb4778b8432f1ae86dae4634c0b611cb269a4c2f" }, - "gitsigns.nvim": { "branch": "main", "commit": "d195f0c35ced5174d3ecce1c4c8ebb3b5bc23fa9" }, - "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, - "lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" }, - "neo-tree.nvim": { "branch": "main", "commit": "134c46625abdb18b1b3bb844b3cbb946d95c5557" }, - "nui.nvim": { "branch": "main", "commit": "c9b4de623d19a85b353ff70d2ae9c77143abe69c" }, - "nvim-autopairs": { "branch": "master", "commit": "9fd41181693dd4106b3e414a822bb6569924de81" }, + "gitsigns.nvim": { "branch": "main", "commit": "0a2a93f687ec051292943a4d139366332ac93688" }, + "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, + "lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" }, + "neo-tree.nvim": { "branch": "main", "commit": "e578fe7a5832421b0d2c5b3c0a7a1e40e0f6a47a" }, + "nui.nvim": { "branch": "main", "commit": "35da9ca1de0fc4dda96c2e214d93d363c145f418" }, + "nvim-autopairs": { "branch": "master", "commit": "096d0baecc34f6c5d8a6dd25851e9d5ad338209b" }, "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, - "nvim-lint": { "branch": "master", "commit": "f98b1efe0d20b98b64fd0fd117435883b5c22eb3" }, - "nvim-lspconfig": { "branch": "master", "commit": "9099871a7c7e1c16122e00d70208a2cd02078d80" }, - "nvim-web-devicons": { "branch": "master", "commit": "43aa2ddf476012a2155f5f969ee55ab17174da7a" }, + "nvim-lint": { "branch": "master", "commit": "8e5920f9ce9f24c283a2e64be5fe58d1d37d1744" }, + "nvim-lspconfig": { "branch": "master", "commit": "8917d2c830e04bf944a699b8c41f097621283828" }, + "nvim-web-devicons": { "branch": "master", "commit": "b427ac5f9dff494f839e81441fb3f04a58cbcfbc" }, "omnisharp-extended-lsp.nvim": { "branch": "main", "commit": "4be2e8689067494ed7e5a4f1221adc31d1a07783" }, - "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, - "telescope.nvim": { "branch": "master", "commit": "aacaa9cd031da83ce08d8fa5f19083d731f7f62c" }, - "toggleterm.nvim": { "branch": "main", "commit": "e3805fed94d487b81e9c21548535cc820f62f840" } + "plenary.nvim": { "branch": "master", "commit": "663246936325062427597964d81d30eaa42ab1e4" }, + "telescope.nvim": { "branch": "master", "commit": "1bfbb1fb5c56d2dbe33216fcb2ebe82e499aa06c" }, + "toggleterm.nvim": { "branch": "main", "commit": "b49df5cdce67a8964d1b027dae94bde212092b51" } }
\ No newline at end of file diff --git a/configs/nvim/lua/crupest/nvim/lsp/csharp.lua b/configs/nvim/lua/crupest/nvim/lsp/csharp.lua index 066f305..f5cd29b 100644 --- a/configs/nvim/lua/crupest/nvim/lsp/csharp.lua +++ b/configs/nvim/lua/crupest/nvim/lsp/csharp.lua @@ -1,70 +1,12 @@ local lspconfig = require("lspconfig"); local capabilities = require("cmp_nvim_lsp").default_capabilities() -local is_win = require("crupest.system").is_win -local is_mac = require("crupest.system").is_mac -local first_exe = require("crupest.system.find").first_exe - -local win_paths = { "C:/Users/crupest/Programs/omnisharp-win-x64/OmniSharp.exe" } -local mac_paths = { "/usr/local/opt/omnisharp/OmniSharp" } local function setup_lsp_csharp() - local paths = {} - - if is_win then - paths = win_paths - elseif is_mac then - paths = mac_paths - end - - local omnisharp_path = first_exe(paths) - - if omnisharp_path then - lspconfig.omnisharp.setup { - capabilities = capabilities, - - handlers = { - ["textDocument/definition"] = require('omnisharp_extended').handler, - }, - - cmd = { omnisharp_path }, - - -- Enables support for reading code style, naming convention and analyzer - -- settings from .editorconfig. - enable_editorconfig_support = true, - - -- If true, MSBuild project system will only load projects for files that - -- were opened in the editor. This setting is useful for big C# codebases - -- and allows for faster initialization of code navigation features only - -- for projects that are relevant to code that is being edited. With this - -- setting enabled OmniSharp may load fewer projects and may thus display - -- incomplete reference lists for symbols. - enable_ms_build_load_projects_on_demand = false, - - -- Enables support for roslyn analyzers, code fixes and rulesets. - enable_roslyn_analyzers = false, - - -- Specifies whether 'using' directives should be grouped and sorted during - -- document formatting. - organize_imports_on_format = false, - - -- Enables support for showing unimported types and unimported extension - -- methods in completion lists. When committed, the appropriate using - -- directive will be added at the top of the current file. This option can - -- have a negative impact on initial completion responsiveness, - -- particularly for the first few completion sessions after opening a - -- solution. - enable_import_completion = true, - - -- Specifies whether to include preview versions of the .NET SDK when - -- determining which version to use for project loading. - sdk_include_prereleases = true, - - -- Only run analyzers against open files when 'enableRoslynAnalyzers' is - -- true - analyze_open_documents_only = false, - } - end + lspconfig.csharp_ls.setup { + capabilities = capabilities, + root_dir = lspconfig.util.root_pattern("*.csproj"), + } end return { |