neovim: add csharp treesitter and lsp

This commit is contained in:
LavaDesu 2021-09-01 15:48:11 +07:00
parent a7ce9a61ce
commit 89b7afd817
Signed by: cilly
GPG key ID: 6500251E087653C9
2 changed files with 33 additions and 0 deletions

View file

@ -25,6 +25,7 @@
(nvim-treesitter.withPlugins (p: with p; [ (nvim-treesitter.withPlugins (p: with p; [
tree-sitter-comment tree-sitter-comment
tree-sitter-c-sharp
# tree-sitter-javascript # tree-sitter-javascript
tree-sitter-jsdoc tree-sitter-jsdoc
tree-sitter-nix tree-sitter-nix
@ -127,6 +128,7 @@
}; };
}; };
"eslint.enable" = true; "eslint.enable" = true;
"omnisharp.path" = "${pkgs.omnisharp-roslyn}/bin/omnisharp";
"rust-analyzer.lens.enable" = false; "rust-analyzer.lens.enable" = false;
"rust-analyzer.inlayHints.enable" = false; "rust-analyzer.inlayHints.enable" = false;
"rust-analyzer.serverPath" = pkgs.rust-analyzer + "/bin/rust-analyzer"; "rust-analyzer.serverPath" = pkgs.rust-analyzer + "/bin/rust-analyzer";

31
overlays/tree-sitter.nix Normal file
View file

@ -0,0 +1,31 @@
# experiment!
self: super:
let
lib = super.lib;
stdenv = super.stdenv;
in {
tree-sitter = super.tree-sitter.overrideAttrs(o: {
passthru = o.passthru // {
withPlugins = grammarFn:
let
grammars = grammarFn o.passthru.builtGrammars;
in
super.linkFarm "grammars"
(map
(drv:
let
name = lib.strings.getName drv;
in
{
name =
(lib.strings.replaceStrings ["-"] ["_"]
(lib.strings.removePrefix "tree-sitter-"
(lib.strings.removeSuffix "-grammar" name)))
+ stdenv.hostPlatform.extensions.sharedLibrary;
path = "${drv}/parser";
}
)
grammars);
};
});
}