Skip to content

Simplify try statement, accept missing else/except/finally #304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

maxbrunsfeld
Copy link
Contributor

This makes the parser more useful for editors, since the try_statement will still be identified, even if it's incomplete.

@clason
Copy link

clason commented May 28, 2025

If you update the parser to ABI 15, you also need to update the bindings to match (tree-sitter init --update).

@clason
Copy link

clason commented May 28, 2025

  1. Apparently the package-lock.json is out of date? Try npm update and commit the result. (Also cargo update for good luck.)
  2. You are using a(n outdated) distro build of tree-sitter CLI that strips the commit info. Either use a cargo build from the v0.25.5 tag of a local checkout, or add generate: false to the parser-test-action step.

@maxbrunsfeld
Copy link
Contributor Author

I'm using the latest version of Tree-sitter CLI via cargo install tree-sitter-cli. That should be a supported workflow. This build sha thing is not helpful right now.

@clason
Copy link

clason commented May 28, 2025

I'm using the latest version of Tree-sitter CLI via cargo install tree-sitter-cli.

Didn't you just release a new version? ;) It looks like you're using a distro build of v0.25.4 (distro I'm guessing, but the version is right there in the diff.)

@maxbrunsfeld
Copy link
Contributor Author

Didn't you just release a new version?

Yeah, but the same error occurred before that; the problem is that you don't get a BUILD SHA apparently if you cargo install.

@clason
Copy link

clason commented May 28, 2025

(I do agree FWIW; it can be useful info but in combination with the overbearing workflows it's obnoxious.)

@maxbrunsfeld
Copy link
Contributor Author

I get the good intention behind failing the build if the parser changed, but combined with the build sha thing, it's causing problems. It's nobody's fault, just observing some pain points that have arisen with Tree-sitter because of a few good ideas combining badly.

@clason
Copy link

clason commented May 28, 2025

Maybe the workflow can ignore the first line of that diff (git diff |tail -n +1); that would sand off the sharpest edges here.

@clason
Copy link

clason commented May 28, 2025

@clason
Copy link

clason commented May 28, 2025

(Not a maintainer here so I can't push to your PR; otherwise it'd be an easy fix for me.)

@maxbrunsfeld maxbrunsfeld force-pushed the simplify-try-statement branch from 1377915 to 260dd63 Compare May 28, 2025 18:20
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