plugins/syntax: fix tree-sitter parsers
This commit is contained in:
parent
69355e6429
commit
6dd623dd38
3 changed files with 12 additions and 5 deletions
|
@ -9,6 +9,7 @@
|
||||||
, theme ? { }
|
, theme ? { }
|
||||||
, plugins ? { }
|
, plugins ? { }
|
||||||
, wrapNeovim
|
, wrapNeovim
|
||||||
|
, runCommand
|
||||||
, neovim-unwrapped
|
, neovim-unwrapped
|
||||||
, tree-sitter
|
, tree-sitter
|
||||||
, neovimPlugins
|
, neovimPlugins
|
||||||
|
@ -27,7 +28,7 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
pluginParams = neovimPlugins // {
|
pluginParams = neovimPlugins // {
|
||||||
inherit tree-sitter fetchFromGitHub;
|
inherit runCommand tree-sitter fetchFromGitHub;
|
||||||
inherit plugins enableDevIcons enableTabby enableOrgMode;
|
inherit plugins enableDevIcons enableTabby enableOrgMode;
|
||||||
themeCfg = theme;
|
themeCfg = theme;
|
||||||
lib = myLib;
|
lib = myLib;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{ lib
|
{ lib
|
||||||
|
, runCommand
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, ...
|
, ...
|
||||||
} @ inputs:
|
} @ inputs:
|
||||||
|
@ -24,11 +25,13 @@ let
|
||||||
grammars = tree-sitter.withPlugins (g: [ g.tree-sitter-d2 ]);
|
grammars = tree-sitter.withPlugins (g: [ g.tree-sitter-d2 ]);
|
||||||
|
|
||||||
nvim-treesitter = inputs.nvim-treesitter.withAllGrammars.overrideAttrs (oldAttrs: {
|
nvim-treesitter = inputs.nvim-treesitter.withAllGrammars.overrideAttrs (oldAttrs: {
|
||||||
|
passthru.dependencies = oldAttrs.passthru.dependencies ++ [
|
||||||
|
(runCommand "nvim-treesitter-d2-grammar" { } ''
|
||||||
|
mkdir -p $out/parser
|
||||||
|
ln -s ${grammars}/d2.so $out/parser/d2.so
|
||||||
|
'')
|
||||||
|
];
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
rm -r parser
|
|
||||||
mkdir parser
|
|
||||||
ln -s ${grammars}/d2.so parser/d2.so
|
|
||||||
|
|
||||||
ln -s ${extraGrammars.tree-sitter-d2.src}/queries queries/d2
|
ln -s ${extraGrammars.tree-sitter-d2.src}/queries queries/d2
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
||||||
|
parser_config.d2 = {}
|
||||||
|
|
||||||
require("nvim-treesitter.configs").setup({
|
require("nvim-treesitter.configs").setup({
|
||||||
ensure_installed = {},
|
ensure_installed = {},
|
||||||
sync_install = false,
|
sync_install = false,
|
||||||
|
|
Reference in a new issue