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

Consider alias for interface declaration body? #269

Closed
helixbass opened this issue Dec 21, 2023 · 0 comments · Fixed by #273
Closed

Consider alias for interface declaration body? #269

helixbass opened this issue Dec 21, 2023 · 0 comments · Fixed by #273

Comments

@helixbass
Copy link

Hi,
I just ran into the fact that (interface_declaration)'s body is an (object_type)

Basically it seems unexpected/inconvenient that then there's no (easy) way to target just "object type literals" eg in a tree-sitter query (since if you do a query for (object_type) it will also capture the {...} part of interface declarations, which conceptually seems like a very different thing than an object type literal)

So from my limited understanding of tree-sitter grammars maybe the easiest fix would be to alias the (interface_declaration) body field's node to some other name besides object_type (eg interface_declaration_body)?

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 a pull request may close this issue.

1 participant