Skip to content

Field parent is wrong #61

Closed
Closed

Description

@sguillia

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!

Activity

  1. maxbrunsfeld commented on Apr 3, 2020

    @maxbrunsfeld
    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.

  2. maxbrunsfeld commented on Apr 3, 2020

    @maxbrunsfeld
    Contributor

    The fix is in v0.16.1.

  3. added a commit that references this issue on Sep 29, 2026
    c7b44f6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions