Skip to content
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

feat: support changing file modes #12

Merged
merged 3 commits into from
May 13, 2024

Conversation

ribru17
Copy link
Contributor

@ribru17 ribru17 commented May 12, 2024

This commit also properly exposes the similarity index as a node (previously field would not work for anonymous regex nodes). It also updates the Tree-sitter version, which generated the associated new bindings.

EDIT: It also exposes the argument portion of the (command) node

@the-mikedavis
Copy link
Owner

You're saying that (similarity score: _ @somecapture) doesn't work when that field is just a regex? Switching to a named score node instead seems ok to me.

Could you undo the unrelated changes? The PR can just be the line about the similarity node - the CI will take care of regenerating the parser.c

@ribru17
Copy link
Contributor Author

ribru17 commented May 12, 2024

Could you undo the unrelated changes? The PR can just be the line about the similarity node - the CI will take care of regenerating the parser.c

Sure, sorry for the giant diff 😆

You're saying that (similarity score: _ @somecapture) doesn't work when that field is just a regex? Switching to a named score node instead seems ok to me.

For me, no: I got invalid structure complaints. Also I was never able to even see the field exposed in the parsed tree

ribru17 added 3 commits May 13, 2024 10:43
It was previously a field, but a field is an impossible pattern for a
regex literal like we use for score. I.e.:

    (similarity score: _ @_some_capture_)

Cannot match and on recent tree-sitter versions will cause an error
during query analysis.
Changes that are only permissions take the shape `old/new mode <mode>`.
@the-mikedavis
Copy link
Owner

Thanks! I've pushed to split the changes up a little, so the commit history is easier to follow.

@the-mikedavis the-mikedavis merged commit 100a7b6 into the-mikedavis:main May 13, 2024
1 check passed
@ribru17
Copy link
Contributor Author

ribru17 commented May 13, 2024

Of course, and thank you!

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