Skip to content

Add TSUpdateSync to ansible nvim recipe#68

Open
michaelbarton wants to merge 7 commits intomasterfrom
claude/fix-nvim-tab-error-GLR5g
Open

Add TSUpdateSync to ansible nvim recipe#68
michaelbarton wants to merge 7 commits intomasterfrom
claude/fix-nvim-tab-error-GLR5g

Conversation

@michaelbarton
Copy link
Owner

Summary

  • Adds a TSUpdateSync step to the ansible neovim recipe after Lazy! sync, so treesitter parsers are updated to match the queries shipped with nvim-treesitter
  • Fixes the "Invalid node type 'tab'" / "Invalid node type 'substitute'" errors caused by stale parsers
  • Fixes pre-existing black formatting issue in offlineimap/offlineimap.py

Test plan

  • Run the ansible neovim playbook and verify TSUpdateSync completes
  • Open nvim and confirm no treesitter errors appear

See: nvim-treesitter/nvim-treesitter#8369

https://claude.ai/code/session_01SjsUhg3Q9k8a3nmnDUoMii

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants