Open
Conversation
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: nvim-treesitter/nvim-treesitter#8369 https://claude.ai/code/session_01SjsUhg3Q9k8a3nmnDUoMii
The previous fix tried to remove a stale parser file, but the real issue is the vim highlights query referencing a "tab" node type that doesn't exist in the installed tree-sitter-vim parser. This fix reads the query files at startup, strips the "tab" reference, and re-sets the patched query via vim.treesitter.query.set(). See: nvim-treesitter/nvim-treesitter#8369 https://claude.ai/code/session_01SjsUhg3Q9k8a3nmnDUoMii
The previous runtime patching approach couldn't be verified. Pinning to commit d0bf5ff (Dec 17, before the "tab" node was added to vim/highlights.scm) is a known working fix. See: nvim-treesitter/nvim-treesitter#8369 https://claude.ai/code/session_01SjsUhg3Q9k8a3nmnDUoMii
Collapse multi-line raise onto single line to satisfy black --line-length=100 check. https://claude.ai/code/session_01SjsUhg3Q9k8a3nmnDUoMii
The pin approach prevents the issue at the source by using a known working nvim-treesitter version, rather than cleaning up stale parsers at runtime. https://claude.ai/code/session_01SjsUhg3Q9k8a3nmnDUoMii
Instead of pinning to a specific commit (which still had invalid types like "substitute"), dynamically filter out any node types from the vim highlights query that don't exist in the installed parser. This handles all current and future mismatches without needing to guess commits. See: nvim-treesitter/nvim-treesitter#8369 https://claude.ai/code/session_01SjsUhg3Q9k8a3nmnDUoMii
The root cause was stale treesitter parsers not matching the queries shipped with nvim-treesitter. Running TSUpdateSync after Lazy sync installs matching parsers, making the runtime workaround unnecessary. https://claude.ai/code/session_01SjsUhg3Q9k8a3nmnDUoMii
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TSUpdateSyncstep to the ansible neovim recipe afterLazy! sync, so treesitter parsers are updated to match the queries shipped with nvim-treesitter"Invalid node type 'tab'"/"Invalid node type 'substitute'"errors caused by stale parsersblackformatting issue inofflineimap/offlineimap.pyTest plan
TSUpdateSynccompletesSee: nvim-treesitter/nvim-treesitter#8369
https://claude.ai/code/session_01SjsUhg3Q9k8a3nmnDUoMii