Repository navigation
fix(diffr): remove fold query conflicts in bundled queries - #1084
Merged
Merged
Conversation
A body run starting at the first statement gave that statement two folds when it also folds itself (a list, pipeline, if or loop). Agent-Session: 4fa14265-1d4d-4ea8-b2f0-abdee40eb54d Agent-Session: 01a122cb-3cae-7ac3-b791-09a8faa89ffd Agent-Session: 01a12325-f61d-73b2-846e-9886a80037d5 Agent-Session: 01a12327-e4f9-7652-bc41-f37bec9965f4 Agent-Session: 8881e3f3-a916-4405-9706-bb6e3a2f193d
A body run starting at the first statement gave that statement two folds when it also folds itself. Dropping the else relevant region shifts fold ids in one golden; its output is unchanged. Agent-Session: 4fa14265-1d4d-4ea8-b2f0-abdee40eb54d Agent-Session: 01a122cb-3cae-7ac3-b791-09a8faa89ffd Agent-Session: 01a12325-f61d-73b2-846e-9886a80037d5 Agent-Session: 01a12327-e4f9-7652-bc41-f37bec9965f4 Agent-Session: 8881e3f3-a916-4405-9706-bb6e3a2f193d
…line
Both branches of the label alternation matched `outer: for {`, folding
one block with two indents.
Agent-Session: 4fa14265-1d4d-4ea8-b2f0-abdee40eb54d
Agent-Session: 01a122cb-3cae-7ac3-b791-09a8faa89ffd
Agent-Session: 01a12325-f61d-73b2-846e-9886a80037d5
Agent-Session: 01a12327-e4f9-7652-bc41-f37bec9965f4
Agent-Session: 8881e3f3-a916-4405-9706-bb6e3a2f193d
The condition owned it, and context also folds a condition that is a call. Agent-Session: 4fa14265-1d4d-4ea8-b2f0-abdee40eb54d Agent-Session: 01a122cb-3cae-7ac3-b791-09a8faa89ffd Agent-Session: 01a12325-f61d-73b2-846e-9886a80037d5 Agent-Session: 01a12327-e4f9-7652-bc41-f37bec9965f4 Agent-Session: 8881e3f3-a916-4405-9706-bb6e3a2f193d
The open-ended and body patterns folded one sequence with different indents. Agent-Session: 4fa14265-1d4d-4ea8-b2f0-abdee40eb54d Agent-Session: 01a122cb-3cae-7ac3-b791-09a8faa89ffd Agent-Session: 01a12325-f61d-73b2-846e-9886a80037d5 Agent-Session: 01a12327-e4f9-7652-bc41-f37bec9965f4 Agent-Session: 8881e3f3-a916-4405-9706-bb6e3a2f193d
An unanchored "(" could match more than one child.
Agent-Session: 4fa14265-1d4d-4ea8-b2f0-abdee40eb54d
Agent-Session: 01a122cb-3cae-7ac3-b791-09a8faa89ffd
Agent-Session: 01a12325-f61d-73b2-846e-9886a80037d5
Agent-Session: 01a12327-e4f9-7652-bc41-f37bec9965f4
Agent-Session: 8881e3f3-a916-4405-9706-bb6e3a2f193d
The same folds, written so each pattern's captures are determined by its owner. Agent-Session: 4fa14265-1d4d-4ea8-b2f0-abdee40eb54d Agent-Session: 01a122cb-3cae-7ac3-b791-09a8faa89ffd Agent-Session: 01a12325-f61d-73b2-846e-9886a80037d5 Agent-Session: 01a12327-e4f9-7652-bc41-f37bec9965f4 Agent-Session: 8881e3f3-a916-4405-9706-bb6e3a2f193d
Agent-Session: 4fa14265-1d4d-4ea8-b2f0-abdee40eb54d Agent-Session: 01a122cb-3cae-7ac3-b791-09a8faa89ffd Agent-Session: 01a12325-f61d-73b2-846e-9886a80037d5 Agent-Session: 01a12327-e4f9-7652-bc41-f37bec9965f4 Agent-Session: 8881e3f3-a916-4405-9706-bb6e3a2f193d
thesiti92
approved these changes
Oct 10, 2026
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.
Fix an issue some users were hitting w/ diffr's builtin queries clashing.
I tried, at first, to set up a deterministic testing harness but seems a bit hard to do bc it depends on tree-sitter behavior + how it actually responds to the queries / constructing a model there.
it's too easy to represent bad/illegal state with the query architecture here. a better solution might be:
that's a bigger change so this is a band-aid in the meantime.
https://claude.ai/code/session_01DUhupf8DSVYZ4Cif39LxWd