From b0b15b969bcf869fd2adac4ba1df9b276efcdb52 Mon Sep 17 00:00:00 2001 From: "zizhou teng (n451)" <2020200706@ruc.edu.cn> Date: Wed, 28 Jan 2026 15:05:34 +0000 Subject: [PATCH] fix: env is optional field --- lua/nvim-treesitter/_meta/parsers.lua | 2 +- lua/nvim-treesitter/install.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/nvim-treesitter/_meta/parsers.lua b/lua/nvim-treesitter/_meta/parsers.lua index 54b613699..4850ff9c2 100644 --- a/lua/nvim-treesitter/_meta/parsers.lua +++ b/lua/nvim-treesitter/_meta/parsers.lua @@ -28,7 +28,7 @@ error('Cannot require a meta file') ---@field queries? string --- ---Envrionment variables for generating the parser ----@field env table +---@field env? table ---@class ParserInfo --- diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 82cb1cf6e..fa44d1932 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -167,7 +167,7 @@ end ---@param compile_location string ---@return string? err local function do_generate(logger, repo, compile_location) - local env = vim.tbl_extend('force', { TREE_SITTER_JS_RUNTIME = 'native' }, repo.env) + local env = vim.tbl_extend('force', { TREE_SITTER_JS_RUNTIME = 'native' }, repo.env or {}) local from_json = true if repo.generate_from_json == false then from_json = false