You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As expected, property_signature [1, 4] - [1, 16] refers to the lat definition.
However, there's no sub-node for the optional specifier, that is, the ? next to lat, or, alternatively, some other node type that indicates the member is optional.
Perhaps this is not a bug, but it is surprising nonetheless, unless I'm missing something.
Also note that:
interfaceFoo{lat: number,}
that is, with no ?, gets the very same tree (except different ranges of course).
Steps To Reproduce/Bad Parse Tree
(please see above)
Expected Behavior/Parse Tree
Not exactly sure what the fully correct tree should look like, but I would expect an additional or alternative sub-node that indicates the member is optional.
Repro
Just my example above.
Thanks!
The text was updated successfully, but these errors were encountered:
so it's a bit intriguing that AFAICS this has not been noted before (or perhaps downstream tooling simply manages to determine the optional member situation via other means (which is not difficult anyway).
Did you check existing issues?
Tree-Sitter CLI Version, if relevant (output of
tree-sitter --version
)No response
Describe the bug
Please consider this typescript definition:
Using the playground, here's the corresponding tree:
As expected,
property_signature [1, 4] - [1, 16]
refers to thelat
definition.However, there's no sub-node for the optional specifier, that is, the
?
next tolat
, or, alternatively, some other node type that indicates the member is optional.Perhaps this is not a bug, but it is surprising nonetheless, unless I'm missing something.
Also note that:
that is, with no
?
, gets the very same tree (except different ranges of course).Steps To Reproduce/Bad Parse Tree
(please see above)
Expected Behavior/Parse Tree
Not exactly sure what the fully correct tree should look like, but I would expect an additional or alternative sub-node that indicates the member is optional.
Repro
Just my example above.
Thanks!
The text was updated successfully, but these errors were encountered: