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

Field parent is wrong #61

Closed
sguillia opened this issue Apr 3, 2020 · 2 comments
Closed

Field parent is wrong #61

sguillia opened this issue Apr 3, 2020 · 2 comments

Comments

@sguillia
Copy link

sguillia commented Apr 3, 2020

Hi!

I have been using fields like described in this comment #54 (comment)

They work well for accessing childs, but not parents

As an example, I would expect node.functionNode.parent to be node, but it isn't

Here is a minimum reproducible example, just follow the instructions in the readme
https://github.com/sguillia/tree-sitter-repro/blob/master/main.ts

This is slightly related to tree-sitter/tree-sitter-javascript#127
I had some parents with type _expression that went away with some void expressions.

Is there any way to still access fields parents?

Thank you!

@maxbrunsfeld
Copy link
Contributor

Thanks so much for the reproduction script. This is fixed on Tree-sitter master. I'll close this when I upgrade the Tree-sitter submodule.

@maxbrunsfeld
Copy link
Contributor

The fix is in v0.16.1.

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

No branches or pull requests

2 participants