Skip to content

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

Draft
oddcelot wants to merge 2 commits into
zed-rxfrom
zed-rx-grammar-pin
Draft

oddcelot wants to merge 2 commits 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. It exits 1 when they differ and names the last commit that touched the grammar. It exits 2 when it can't run at all, for example because rev can't be fetched.

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's the last step, so a stale pin doesn't hide a failing build. A difference fails on a push to main and only warns anywhere else. A grammar PR could pin one of its own commits, but after a squash merge that commit isn't on main, so the bump to the squash commit comes in a follow-up. A check that can't run fails everywhere.

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 exits 1 on an older pin and on a temporary grammar commit, and 2 on a rev that doesn't exist. I ran the step's shell logic for a PR, a push to main and a workflow_dispatch on a branch, with each exit status. 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