dot

NixOS dotfiles
git clone https://git.echoz.io/dot.git
Log | Files | Refs

commit 8129ab0998d57b4ed656169d69e8ce71ab82f4d5
parent 8e2b0927cf63ca4b8dae4f02d3916ab85f2efe2a
Author: Chris <chris@echoz.io>
Date:   Fri, 28 Nov 2025 12:53:29 +0100

feat(neovim): re-add tree-sitter with a smaller selection of grammars in an attempt to get lsp hovers highlighted

Diffstat:
Mmodules/neovim/default.nix | 29++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/modules/neovim/default.nix b/modules/neovim/default.nix @@ -4,7 +4,7 @@ ... }: let - runtime = luaRuntime // lspRuntime // ftpluginRuntime; + runtime = luaRuntime // lspRuntime // ftpluginRuntime // treesitterRuntime; initLua = generateInitLua runtime { cheat-sheet.file = ./cheat-sheet.txt; @@ -81,6 +81,33 @@ let }; }; + treesitterRuntime = + let + languages = [ + "typescript" + "javascript" + "nix" + "lua" + "go" + "python" + ]; + + grammars = pkgs.symlinkJoin { + name = "neovim-grammars"; + paths = lib.mapAttrsToList (_: grammar: pkgs.neovimUtils.grammarToPlugin grammar) ( + lib.filterAttrs ( + _: drv: + lib.isDerivation drv + && builtins.elem (builtins.head (builtins.match "^tree-sitter-(.*)-grammar$" drv.pname)) languages + ) pkgs.tree-sitter-grammars + ); + }; + in + { + parser.source = grammars + "/parser"; + queries.source = grammars + "/queries"; + }; + generateLspRuntime = lsps: (lib.mapAttrs' (name: config: {