From e8b67d2ef1a81714e4d77d978b2c911d4e9234c1 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Thu, 25 Jun 2026 10:13:41 -0500 Subject: [PATCH] neovimUtils: support wasm tree-sitter grammars Teach the existing grammar wrapper to install parser.wasm when users pass a WASI-built grammar. --- .../editors/neovim/to-nvim-treesitter-grammar.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/editors/neovim/to-nvim-treesitter-grammar.sh b/pkgs/applications/editors/neovim/to-nvim-treesitter-grammar.sh index 24e8428ef483..abe16c805309 100644 --- a/pkgs/applications/editors/neovim/to-nvim-treesitter-grammar.sh +++ b/pkgs/applications/editors/neovim/to-nvim-treesitter-grammar.sh @@ -4,7 +4,11 @@ toNvimTreesitterGrammar() { echo "Executing toNvimTreesitterGrammar" mkdir -p "$out/parser" - ln -s "$origGrammar/parser" "$out/parser/$grammarName.so" + if [ -e "$origGrammar/parser.wasm" ]; then + ln -s "$origGrammar/parser.wasm" "$out/parser/$grammarName.wasm" + else + ln -s "$origGrammar/parser" "$out/parser/$grammarName.so" + fi if [ "$installQueries" != 1 ]; then echo "Installing queries is disabled: installQueries=$installQueries"