From 3769ea8022fa3ae9fe8e5b86e8dfa0fb8b98786b Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Feb 2026 22:00:35 +0000 Subject: [PATCH] Fix "Invalid node type 'tab'" treesitter error in nvim Remove stale vim parser from site directory on startup. A cached tree-sitter-vim parser conflicts with nvim-treesitter managed queries that reference the newer 'tab' node type. See: https://github.com/nvim-treesitter/nvim-treesitter/issues/8369 https://claude.ai/code/session_01SjsUhg3Q9k8a3nmnDUoMii --- nvim/lua/plugins/language.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nvim/lua/plugins/language.lua b/nvim/lua/plugins/language.lua index 9ec467e..48ca7ff 100644 --- a/nvim/lua/plugins/language.lua +++ b/nvim/lua/plugins/language.lua @@ -19,6 +19,16 @@ return { "yaml", }, }, + init = function() + -- Remove stale vim parser from site directory that conflicts with + -- nvim-treesitter managed parsers, causing "Invalid node type 'tab'" error. + -- See: https://github.com/nvim-treesitter/nvim-treesitter/issues/8369 + local stale_parser = vim.fn.stdpath("data") .. "/site/parser/vim.so" + local fs = vim.uv or vim.loop + if fs.fs_stat(stale_parser) then + os.remove(stale_parser) + end + end, }, { "mason-org/mason.nvim",