Skip to content

fix: remove "else if" node from query#19

Merged
qvalentin merged 1 commit intomainfrom
fix/else-if-node-in-newer-ts-grammer
Oct 31, 2025
Merged

fix: remove "else if" node from query#19
qvalentin merged 1 commit intomainfrom
fix/else-if-node-in-newer-ts-grammer

Conversation

@qvalentin
Copy link
Copy Markdown
Owner

@qvalentin qvalentin commented Oct 31, 2025

this node type was removed in https://github.com/ngalaiko/tree-sitter-go-template

fixes #18

For now this will break the support for else if for people not using the latest (main) version of nvim-treesitter

Summary by CodeRabbit

  • Bug Fixes
    • Updated parser to correctly handle conditional block syntax, restricting the "else" branch to standalone else statements and removing support for else-if combinations in specific parsing contexts.

this node type was removed in https://github.com/ngalaiko/tree-sitter-go-template

fixes #18

For now this will break the support for else if for people not using the
latest (main) version of nvim-treesitter
@qvalentin qvalentin merged commit 5863e05 into main Oct 31, 2025
6 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Oct 31, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Modified the helm template query parser to remove support for "else if" nodes and only support "else" nodes, fixing compatibility with the current version of the tree-sitter-go-template parser.

Changes

Cohort / File(s) Summary
Query Compatibility Fix
lua/helm-ls/queries.lua
Narrowed M.action_parts middle alternative from matching both "else" and "else if" to only "else", aligning with current treesitter grammar

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

  • Single-line query syntax change addressing a known treesitter parser incompatibility

Poem

🐰 An "else if" once troubled the tree,
But now only "else" we decree,
The parser is mended,
The conflicts now ended,
Helm templates flow smooth as can be! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/else-if-node-in-newer-ts-grammer

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 142777b and fdd5eca.

📒 Files selected for processing (1)
  • lua/helm-ls/queries.lua (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

bug: Invalid node type "else if" after upgrade to nvim-treesitter main

1 participant