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
{{ message }}
Repository navigation
Line info for test_reflective_loader package tests can easily get out of sync #5544
And the current UI, although it does work most of the time, if you add some lines, I've seen them get out of sync (interestingly, the "expect" error labels that show up never do, they're always in the right place) from the method declaration.
I don't know how often this happens, but I'd be interested in an issue for this - because if this happens with those markers, it would also happen to the CodeLens if we switched them over to using the test model data 😔
In Dart SDK, open pkg\analysis_server\test\services\completion\dart\location\dart_doc_test.dart and run all tests.
Add a new line before the first test inside the reflective test class (and wait just a small bit), see that all current checks stay in place while the new line is added:
But interestingly, if you add a new character to any of the assertResponse texts, before the first step, so the output is different:
This is the result. The expected value shows up after the method opening, and the icon to show the test error stays on the line above.
I think what's happening here is that VS Code is correctly tracking that the test marker needs moving when you edit the file, but the modification triggers new outline data from the server, which results in us "rebuilding" the test model.. and when we do that, we tell VS Code again that this test is on line 17, even though it is not anymore.
I think we need to ensure we never update the location of an existing test in the tree if its location was not from an outline node.
Activity
DanTup commentedon Jun 11, 2025
Thanks - I can reproduce this.
I think what's happening here is that VS Code is correctly tracking that the test marker needs moving when you edit the file, but the modification triggers new outline data from the server, which results in us "rebuilding" the test model.. and when we do that, we tell VS Code again that this test is on line 17, even though it is not anymore.
I think we need to ensure we never update the location of an existing test in the tree if its location was not from an outline node.
Don't update test locations unless source == Outline