Skip to content

zed-rx: check that the grammar pin is current - #6

Draft
oddcelot wants to merge 1 commit into
zed-rxfrom
zed-rx-grammar-pin
Draft

oddcelot wants to merge 1 commit into
zed-rxfrom
zed-rx-grammar-pin

Conversation

@oddcelot

@oddcelot oddcelot commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to solidjs#92.

Zed only picks up a grammar change once rev in extension.toml is bumped, and nothing reminds anyone to do it. check-pin.sh compares the tooling/tree-sitter-rx tree at the pinned rev with HEAD's. When they differ, it fails and prints the last commit that touched the grammar as the rev to bump to.

It compares trees rather than asking whether commits came after rev. A rev set to a branch commit drops out of main's history after a squash merge, but the check should still pass as long as the grammar is the same.

In CI it only fails on main. A pull request that changes the grammar gets a warning instead: it can't pin its own squash commit, since that commit only exists after the merge, so the bump has to come in a follow-up.

The workflow also changes:

  • tooling/tree-sitter-rx/** is in paths, so grammar changes run it.
  • Checkout uses fetch-depth: 0, because naming the commit to bump to needs history. The full history is about 7 MB, so I didn't try anything narrower.

Locally it passes on the current pin. It fails on an older pin and names b470614, and it fails on a temporary grammar commit and names that commit. I haven't seen it run in Actions yet.

Based on zed-rx, so the diff only shows this change.

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.

1 participant