-
Notifications
You must be signed in to change notification settings - Fork 60
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
Rowan upgrade to 0.16.0 breaks prev_sibling
behaviour
#175
Comments
@milianw Might be related to your PR #171 as it slightly changed the |
Hey @MalteJanz, sorry for that if it's my patch. Quite the pity that rowan doesn't have these test cases in its own repository :( I ran the tests we have in slint, and supposedly it worked for rust-analyzer too (or @Veykril?) Have you tried reverting my patch to verify that it is to blame? If that is the case, maybe it should be reverted for now? How can I reproduce the failure, can you write down the required steps for me to run? Then I might be able to find some time the next days to investigate. |
Hi, thanks for the quick response. I didn't investigate further yet if it is really related to your change, it was just a guess based on the commits of the new version. I also find it unfortunate that the rowan repository itself doesn't have a proper test suite 🙈 For reproducing it, feel free to:
|
The patch f06a2c9 changed the code to use skip instead of nth, which lead to an off-by-one bug that was uncovered by unit tests in ludtwig, see [1]. [1]: MalteJanz/ludtwig#122 Fixes: rust-analyzer#175
Thanks for spotting this @MalteJanz, seems like the issue lurked in #119 and my new PR should handle that |
Discovered by MalteJanz/ludtwig#122
The failed test pipeline contains a bunch of issues related to the rowan upgrade that might need further investigation. But I think the easiest failing test is the following:
(can be found here)
Btw: I wrote this test while fixing my previous rowan contribution, see #143 . It basically came down to a off-by-one error which might regressed with the latest version, see initial issue: #139
Test output:
Which points to the last assertion and last line of the test above. Seems like the sibling somehow got lost 🤔
Test explaination
The parsing input:
produces the following tree:
Note: remember the
HTML_TEXT
node with the "a" word token next to theHTML_TAG
node ("hr" tag)The first declaration of child ends up as the following tree (the outer div):
And doesn't have a previous sibling as expected.
Next up it get's the body of that div tag (isn't stored in a variable), which also looks like expected:
And inside that it get's the first tag which ends up in the second declared
child
variable:As expected that's the
<hr/>
tag. And now comes the previously working call toprev_sibling
on that exact node, which surprisingly ends up withnone
instead of theHTML_TEXT
node.The same test and parser implementation was succeeding in rowan 0.15.16
The text was updated successfully, but these errors were encountered: