Update integration tests to support both possible Go To Implementation results#59956
Update integration tests to support both possible Go To Implementation results#59956sharwell merged 2 commits intodotnet:mainfrom
Conversation
ff73f0c to
5bc5dd0
Compare
This comment was marked as resolved.
This comment was marked as resolved.
5bc5dd0 to
9591976
Compare
| if (activeCaption == $"FileImplementation.cs{dirtyModifier}") | ||
| { | ||
| // The navigation completed synchronously; no further action necessary | ||
| identifierWithCaret = "Implementation$$"; |
There was a problem hiding this comment.
is go-to-impl even synchronous when under the time limit? I think it's async for both. Just that if the async portion takes under a certain time it navigates, else it pops up the dialog.
There was a problem hiding this comment.
yup:
private async Task ExecuteCommandWorkerAsync(
Document document,
int position,
CancellationTokenSource cancellationTokenSource)
{
// Switch to the BG immediately so we can keep as much work off the UI thread.
await TaskScheduler.Default;
So, in order to do this, i think you'll need to at least wait the GoToImplementation test listener. than after that you can check teh state of the editor.
There was a problem hiding this comment.
We already are waiting for this:
|
|
||
| // It's not clear why this delay is necessary. Navigation operations are expected to fully complete as part | ||
| // of one of the above waiters, but GetActiveWindowCaptionAsync appears to return "Program.cs" (the previous | ||
| // window caption) for a short delay after the above complete. |
There was a problem hiding this comment.
def should talk to eidtor. from your descriptions, it sounds like tehy're async updating tab titles. but that's def problematic for tests :(
There was a problem hiding this comment.
In another PR, I'm consolidating this behavior to a new WorkaroundsInProcess class.
There was a problem hiding this comment.
Can this at least link to a tracking bug or that other PR or something?
jasonmalinowski
left a comment
There was a problem hiding this comment.
PR was merged while I was reviewing; I wholehartedly approve its merging. Random comments in the mean time.
|
|
||
| // It's not clear why this delay is necessary. Navigation operations are expected to fully complete as part | ||
| // of one of the above waiters, but GetActiveWindowCaptionAsync appears to return "Program.cs" (the previous | ||
| // window caption) for a short delay after the above complete. |
There was a problem hiding this comment.
Can this at least link to a tracking bug or that other PR or something?
| // The navigation completed synchronously; no further action necessary | ||
| identifierWithCaret = "Implementation$$"; |
There was a problem hiding this comment.
Hmm, so sync navigation puts the caret in one place, and invoking the navigated item puts in a different place? Not crtiical but @CyrusNajmabadi is this intentional?
Fixes #59950