aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2025-10-29 18:36:39 +0100
committerChristian Clason <ch.clason+github@icloud.com>2025-10-30 08:36:00 +0100
commitfd2880e8bc2c39eade94a4d329df3a14e603136d (patch)
tree83e35388dbea6dd12d3294fc9e7d883f76a3a30d /lua
parentfeat(scfg): update parser (diff)
downloadnvim-treesitter-fd2880e8bc2c39eade94a4d329df3a14e603136d.tar
nvim-treesitter-fd2880e8bc2c39eade94a4d329df3a14e603136d.tar.gz
nvim-treesitter-fd2880e8bc2c39eade94a4d329df3a14e603136d.tar.bz2
nvim-treesitter-fd2880e8bc2c39eade94a4d329df3a14e603136d.tar.lz
nvim-treesitter-fd2880e8bc2c39eade94a4d329df3a14e603136d.tar.xz
nvim-treesitter-fd2880e8bc2c39eade94a4d329df3a14e603136d.tar.zst
nvim-treesitter-fd2880e8bc2c39eade94a4d329df3a14e603136d.zip
feat(install): remove node requirement
* supported parsers _must_ commit at least `grammar.json` * set `TREE_SITTER_JS_RUNTIME=native` when generating parser to use built-in quickjs instead of node (requires tree-sitter 0.26)
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-treesitter/health.lua9
-rw-r--r--lua/nvim-treesitter/install.lua2
2 files changed, 1 insertions, 10 deletions
diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua
index 3da7f5415..08ec42bb7 100644
--- a/lua/nvim-treesitter/health.lua
+++ b/lua/nvim-treesitter/health.lua
@@ -65,15 +65,6 @@ local function install_health()
end
end
- do -- node check
- local node = check_exe('node')
- if node then
- health.ok(string.format('node %s (%s)', node.version, node.path))
- else
- health.error('node not found')
- end
- end
-
do -- curl+tar check
local tar = check_exe('tar')
if tar then
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua
index 29c91356c..94d21d46a 100644
--- a/lua/nvim-treesitter/install.lua
+++ b/lua/nvim-treesitter/install.lua
@@ -182,7 +182,7 @@ local function do_generate(logger, repo, compile_location)
'--abi',
tostring(vim.treesitter.language_version),
from_json and 'src/grammar.json' or nil,
- }, { cwd = compile_location })
+ }, { cwd = compile_location, env = { TREE_SITTER_JS_RUNTIME = 'native' } })
if r.code > 0 then
return logger:error('Error during "tree-sitter generate": %s', r.stderr)
end