Add hylo to tree-sitter

This commit is contained in:
Natsu Kagami 2024-07-22 17:37:20 +02:00
parent 9a11fd1b38
commit 581093ff78
Signed by: nki
GPG key ID: 55A032EB38B49ADB
4 changed files with 27 additions and 9 deletions

View file

@ -272,7 +272,7 @@ in
# override inherited files
cat ${tree-sitter-go}/queries/highlights.scm ${src}/queries/templ/highlights.scm > $out/queries/highlights.scm
'';
queries.path = "queries/templ";
queries.path = "queries";
};
go = {
@ -282,6 +282,23 @@ in
queries.src = tree-sitter-go;
queries.path = "queries";
};
hylo =
let
src = pkgs.fetchFromGitHub {
owner = "natsukagami";
repo = "tree-sitter-hylo";
rev = "494cbdff0d13cbc67348316af2efa0286dbddf6f";
hash = "sha256-R5UeoglCTl0do3VDJ/liCTeqbxU9slvmVKNRA/el2VY=";
};
in
{
grammar.src = src;
grammar.compile.args = [ "-c" "-fpic" "../parser.c" "-I" ".." ];
grammar.link.args = [ "-shared" "-fpic" "parser.o" ];
queries.src = src;
queries.path = "queries";
};
};
programs.my-kakoune.package = pkgs.kakoune;

View file

@ -214,7 +214,12 @@ hook global BufCreate .*[.]typ %{
hook global BufCreate .*[.]templ %{
set-option buffer filetype templ
set-option window comment_line "//"
set-option buffer comment_line "//"
}
hook global BufCreate .*[.]hylo %{
set-option buffer filetype hylo
set-option buffer comment_line "//"
}
hook global BufOpenFile .* %{