From 2fe32beed2ef88c4c648c87a3794d9dfef6f1260 Mon Sep 17 00:00:00 2001 From: kossLAN Date: Mon, 19 May 2025 20:09:18 -0400 Subject: [PATCH] init: c# lsp, this sucks --- nix/neovim-overlay.nix | 1 + nvim/ftplugin/cs.lua | 16 ++++++++++++++++ nvim/plugin/base16.lua | 6 +++--- 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 nvim/ftplugin/cs.lua diff --git a/nix/neovim-overlay.nix b/nix/neovim-overlay.nix index ef801f7..537d0c2 100644 --- a/nix/neovim-overlay.nix +++ b/nix/neovim-overlay.nix @@ -106,6 +106,7 @@ with final.pkgs.lib; let vscode-langservers-extracted # various web dev lsps from vscode typescript-language-server # css lsp thing qt6.qtdeclarative # qmlls + omnisharp-roslyn # c# lsp # autoformatters alejandra # amazing nix autoformatter diff --git a/nvim/ftplugin/cs.lua b/nvim/ftplugin/cs.lua new file mode 100644 index 0000000..7b9bb8a --- /dev/null +++ b/nvim/ftplugin/cs.lua @@ -0,0 +1,16 @@ +if vim.fn.executable('OmniSharp') ~= 1 then + return +end + +vim.bo.tabstop = 4 +vim.bo.shiftwidth = 4 +vim.bo.expandtab = true + +local lsp = require('user.lsp') + +vim.lsp.start { + name = 'roslyn', + cmd = { 'OmniSharp', '-z', 'DotNet:enablePackageRestore=false', '--encoding', 'utf-8', '--languageserver' }, + capabilities = lsp.make_client_capabilities(), + on_attach = lsp.on_attach, +} diff --git a/nvim/plugin/base16.lua b/nvim/plugin/base16.lua index a24ee87..94ff2f5 100644 --- a/nvim/plugin/base16.lua +++ b/nvim/plugin/base16.lua @@ -1,6 +1,6 @@ local colors_file = io.open(os.getenv('HOME') .. '/.cache/mutagen/colors.json', 'r') if not colors_file then - vim.notify('Mutagen colors file not found', vim.log.levels.ERROR) + -- vim.notify('Mutagen colors file not found', vim.log.levels.ERROR) return end @@ -9,13 +9,13 @@ colors_file:close() local ok, colors_data = pcall(vim.fn.json_decode, content) if not ok then - vim.notify('Failed to parse Mutagen colors JSON: ' .. tostring(colors_data), vim.log.levels.ERROR) + -- vim.notify('Failed to parse Mutagen colors JSON: ' .. tostring(colors_data), vim.log.levels.ERROR) return end local colors = colors_data.colors if not colors then - vim.notify('No colors found in Mutagen JSON', vim.log.levels.ERROR) + -- vim.notify('No colors found in Mutagen JSON', vim.log.levels.ERROR) return end