Skip to content

Commit e1c5111

Browse files
committed
Automatically wait for rename in GetTagSpans
1 parent f98c8ce commit e1c5111

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpExtractMethod.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ public int Method()
7272

7373
MarkupTestFile.GetSpans(expectedMarkup, out var expectedText, out ImmutableArray<TextSpan> spans);
7474
VisualStudio.Editor.Verify.TextContains(expectedText);
75-
VisualStudio.Workspace.WaitForAsyncOperations(Helper.HangMitigatingTimeout, FeatureAttribute.Rename);
7675
AssertEx.SetEqual(spans, VisualStudio.Editor.GetTagSpans(VisualStudio.InlineRenameDialog.ValidRenameTag));
7776

7877
VisualStudio.Editor.SendKeys("SayHello", VirtualKey.Enter);
@@ -114,7 +113,6 @@ public int Method()
114113

115114
MarkupTestFile.GetSpans(expectedMarkup, out var expectedText, out ImmutableArray<TextSpan> spans);
116115
Assert.Equal(expectedText, VisualStudio.Editor.GetText());
117-
VisualStudio.Workspace.WaitForAsyncOperations(Helper.HangMitigatingTimeout, FeatureAttribute.Rename);
118116
AssertEx.SetEqual(spans, VisualStudio.Editor.GetTagSpans(VisualStudio.InlineRenameDialog.ValidRenameTag));
119117
}
120118
}

src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicExtractMethod.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ End Function
8080

8181
MarkupTestFile.GetSpans(expectedMarkup, out var expectedText, out ImmutableArray<TextSpan> spans);
8282
VisualStudio.Editor.Verify.TextContains(expectedText);
83-
VisualStudio.Workspace.WaitForAsyncOperations(Helper.HangMitigatingTimeout, FeatureAttribute.Rename);
8483
AssertEx.SetEqual(spans, VisualStudio.Editor.GetTagSpans(VisualStudio.InlineRenameDialog.ValidRenameTag));
8584

8685
VisualStudio.Editor.SendKeys("SayHello", VirtualKey.Enter);
@@ -124,7 +123,6 @@ End Sub
124123

125124
MarkupTestFile.GetSpans(expectedMarkup, out var expectedText, out ImmutableArray<TextSpan> spans);
126125
Assert.Equal(expectedText, VisualStudio.Editor.GetText());
127-
VisualStudio.Workspace.WaitForAsyncOperations(Helper.HangMitigatingTimeout, FeatureAttribute.Rename);
128126
AssertEx.SetEqual(spans, VisualStudio.Editor.GetTagSpans(VisualStudio.InlineRenameDialog.ValidRenameTag));
129127
}
130128
}

src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/Editor_OutOfProc.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ public void MoveCaret(int position)
6565

6666
public ImmutableArray<TextSpan> GetTagSpans(string tagId)
6767
{
68+
if (tagId == _instance.InlineRenameDialog.ValidRenameTag)
69+
{
70+
_instance.Workspace.WaitForAsyncOperations(Helper.HangMitigatingTimeout, FeatureAttribute.Rename);
71+
}
72+
6873
var tagInfo = _editorInProc.GetTagSpans(tagId).ToList();
6974

7075
// The spans are returned in an array:

0 commit comments

Comments
 (0)