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
If a node is pointing to # comment1 and I call node.NextSibling(), I would expect this node to be: puts "statement 1", however, it's actually the entire function body:
Is this a bug, or this by design? Because tree-sitter-go doesn't behave this way, and returns the single-line statement following the comment node as expected:
Did you check existing issues?
Tree-Sitter CLI Version, if relevant (output of
tree-sitter --version
)tree-sitter 0.24.4 (fc8c1863e2e5724a0c40bb6e6cfc8631bfe5908b)
Describe the bug
When calling
NextSibling
on a leading method comment, the entire method body is returned, instead of only the next statement.For example, given the following ruby code:
If a node is pointing to
# comment1
and I callnode.NextSibling()
, I would expect this node to be:puts "statement 1"
, however, it's actually the entire function body:Is this a bug, or this by design? Because tree-sitter-go doesn't behave this way, and returns the single-line statement following the comment node as expected:
Click to expand example code
output:
Steps To Reproduce/Bad Parse Tree
Input code:
Parse tree. Leading method comment is unexpectedly outside method body:
Expected Behavior/Parse Tree
Expected parse tree, leading method comment should be inside method body:
Repro
The text was updated successfully, but these errors were encountered: