1This patch makes neovim look for tree-sitter parsers in the directories2specified by TREE_SITTER_GRAMMAR_PATH. Thereby, making it compatible3with the tree-sitter setup used by other Guix packages. e.g. emacs.45diff --git a/runtime/lua/vim/treesitter/language.lua b/runtime/lua/vim/treesitter/language.lua6index f70f99421c..cd424a510f 1006447--- a/runtime/lua/vim/treesitter/language.lua8+++ b/runtime/lua/vim/treesitter/language.lua9@@ -126,15 +126,18 @@ function M.add(lang, opts)10 return nil, string.format('Invalid language name "%s"', lang)11 end1213- local fname = 'parser/' .. lang .. '.*'14- local paths = api.nvim_get_runtime_file(fname, false)15- if #paths == 0 then16- return nil, string.format('No parser for language "%s"', lang)17+ local paths = vim.split(os.getenv('TREE_SITTER_GRAMMAR_PATH') or '', ':')18+ for _, elem in ipairs(paths) do19+ local fname = elem .. '/' .. 'libtree-sitter-' .. lang .. '*'20+ local paths = vim.fn.glob(fname, false, true)21+ if #paths > 0 then22+ path = paths[1]23+ break24+ end25 end26- path = paths[1]27 end2829- local res = loadparser(path, lang, symbol_name)30+ local res = loadparser(path or '', lang, symbol_name)31 return res,32 res == nil and string.format('Cannot load parser %s for language "%s"', path, lang) or nil33 end