feat (home/helix): menhir development

This commit is contained in:
Henri Saudubray 2026-01-22 10:17:38 +01:00
parent f4bc66ab82
commit 715a26a6fe
Signed by: hms
GPG key ID: 7065F57ED8856128

View file

@ -1,4 +1,7 @@
{ pkgs, ... }: { pkgs, ... }:
let
tree-sitter-url = "https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/692b051b09935653befdb8f7ba8afdb640adf17b/runtime/queries/menhir/";
in
{ {
programs.helix = { programs.helix = {
enable = true; enable = true;
@ -31,6 +34,13 @@
environment.RUST_LOG = "info,simple-completion-language-server=info"; environment.RUST_LOG = "info,simple-completion-language-server=info";
environment.LOG_FILE = "/tmp/completion.log"; environment.LOG_FILE = "/tmp/completion.log";
}; };
language-server.ocamllsp = {
command = "ocamllsp";
args = [ "--fallback-read-dot-merlin" ];
};
language-server.menhir-lsp = {
command = "menhir-lsp";
};
language = [ language = [
{ {
name = "typst"; name = "typst";
@ -39,6 +49,24 @@
"scls" "scls"
]; ];
} }
{
name = "menhir";
file-types = [ "mly" ];
language-servers = [
"menhir-lsp"
"ocamllsp"
];
scope = "source.menhir";
}
];
grammar = [
{
name = "menhir";
source = {
git = "https://github.com/Kerl13/tree-sitter-menhir";
rev = "be8866a6bcc2b563ab0de895af69daeffa88fe70";
};
}
]; ];
}; };
extraPackages = with pkgs; [ extraPackages = with pkgs; [
@ -52,4 +80,18 @@
target = ".config/helix/unicode-input/base.toml"; target = ".config/helix/unicode-input/base.toml";
source = ./base.toml; source = ./base.toml;
}; };
home.file.helix-menhir-queries-highlights = {
target = ".config/helix/runtime/queries/menhir/highlights.scm";
source = pkgs.fetchurl {
url = tree-sitter-url + "highlights.scm";
sha256 = "1pgn6prbday0vf82g27l01233ng7i5h95vmijs65r7ynb021grkl";
};
};
home.file.helix-menhir-queries-injections = {
target = ".config/helix/runtime/queries/menhir/injections.scm";
source = pkgs.fetchurl {
url = tree-sitter-url + "injections.scm";
sha256 = "1m29zbrgrk29imha6lpn7an2c4198fi1a8l1q85ibnp5y8ds0v5v";
};
};
} }