feat(nvim): add csharp config
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-10-05 15:17:16 -04:00
parent 919c3cbb66
commit d311d5de3c
3 changed files with 45 additions and 1 deletions

View file

@ -0,0 +1,44 @@
{
config,
pkgs,
lib,
...
}: let
inherit (lib) mkIf;
inherit (config.vars) neovimIde;
in
mkIf neovimIde {
programs = {
neovim = {
extraPackages = builtins.attrValues {
inherit
(pkgs)
csharp-ls
;
};
extraLuaConfig =
# lua
''
vim.api.nvim_create_autocmd('FileType', {
pattern = {'cs'},
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
});
local csharpls_extended = require('csharpls_extended');
require('lspconfig').csharp_ls.setup({
capabilities = require('cmp_nvim_lsp').default_capabilities(),
handlers = {
["textDocument/definition"] = csharpls_extended.handler,
["textDocument/typeDefinition"] = csharpls_extended.handler,
},
});
'';
plugins = builtins.attrValues {
inherit (pkgs.vimPlugins) csharpls-extended-lsp-nvim;
};
};
};
}

View file

@ -10,6 +10,7 @@ in {
imports = [
./bash.nix
./clang.nix
./csharp.nix
./hyprlang.nix
./java.nix
./json.nix

View file

@ -1,7 +1,6 @@
// Common usings for NetDaemon apps
global using System;
global using System.Reactive.Linq;
global using Microsoft.Extensions.Logging;
global using NetDaemon.AppModel;
global using NetDaemon.HassModel;
global using NetDaemon.HassModel.Integration;