Closed peaffenzeller closed 1 week ago
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 :)
yarn upgrade
(or npm upgrade
in old npm versions) will duplicate some dependencies that are depended on in multiple ways, leading to, for example, instanceof
becoming unreliable because classes are loaded multiple times.
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 npm ls -a | grep @lezer
give?
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.