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
There's a bit more to this but overall this is the gist of it.
describe pushes to the group_id_stack. If a describe can't be handled a code lens will not be created, which in turn means that it inside of that describe block references a group that doesn't exist (that at least is my current understanding of why this happens).
You can reproduce this with the following snippet:
The green button is still there for some reason, but the other code lens that would in theory work does not get displayed.
The following should also not break, however I'm not sure how many codelenses it should actually display. One for describe Foo and the bottommost it for sure. Ideally for the describe with a normal string and its testcase as well but the first one might be simpler to implement as a first pass.
I think we might be able to fix this by using a more elaborate regex when interpolation is present. For example, if we have
describe"something #{var} other thing"doend
We could push something <dynamic reference> other thing to the stack to ensure we maintain the structure properly. And for running it, we could turn the dynamic references into match all regexes, something like /something .* other thing/, which would I think is enough to match them.
andyw8
changed the title
Minitest spec code lenses break when describe containts interpolation
Minitest spec code lenses break when describe contains interpolation
Mar 14, 2024
Description
There's a bit more to this but overall this is the gist of it.
describe
pushes to thegroup_id_stack
. If a describe can't be handled a code lens will not be created, which in turn means thatit
inside of thatdescribe
block references a group that doesn't exist (that at least is my current understanding of why this happens).You can reproduce this with the following snippet:
The green button is still there for some reason, but the other code lens that would in theory work does not get displayed.
The following should also not break, however I'm not sure how many codelenses it should actually display. One for
describe Foo
and the bottommostit
for sure. Ideally for thedescribe
with a normal string and its testcase as well but the first one might be simpler to implement as a first pass.The text was updated successfully, but these errors were encountered: