-
Notifications
You must be signed in to change notification settings - Fork 1
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
TreeCursor.iterate continues iterating over sibling nodes #60
Comments
That was indeed a bug. Attached patch should fix it. |
Think this has caused a regression, getting: TypeError: undefined is not an object (evaluating 'children.length') now |
I suspect you upgraded incorrectly, and have duplicated @lezer packages in your node_modules. |
im using codemirror which depends on lezer apparantly, so dont have lezer in my package json. Reverting to 1.2.2 has solved for now :) |
|
Sorry im not really sure what you mean, if I look in my lock file after my app started crashing, I see that this package was updated to 1.2.3, so if I set the resolutions property to keep lezer at 1.2.2 it fixes my issues. The stack trace of the error leads back to this package causing the error. Is that not an issue with this package then? |
In the broken state, what does |
hmm yeah, actually, if I set the resolutions to 1.2.3 it works as well, so for some reason my lock file changed and there was a broken version or something weird happening? |
The docs for
TreeCursor.iterate
sayThat would suggest, that siblings of a node are not included when iterating, only its children. But when I create a new cursor for a given node and call
iterate
on it, it continues iterating also over sibling nodes, see this example.the new cursor used to iterate over the
VariableDeclaration
logs bothconst a = 1
andconst b = 2
, even though - according to the docs - it should stop after its last child.The text was updated successfully, but these errors were encountered: