-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Outlining VSI tests #18508
Outlining VSI tests #18508
Conversation
@@ -0,0 +1,89 @@ | |||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | |||
|
|||
using System; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing these top usings are unused.
Verify(spans, "Debug"); | ||
} | ||
|
||
private void Verify(IDictionary<string, ImmutableArray<TextSpan>> spans, string configuration) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VerifySpansInConfiguration
or something? Just Verify
makes the test method hard to read. It's probably fine since there's only one usage, but if someone added more tests that use it it'd get annoying.
@@ -0,0 +1,46 @@ | |||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | |||
|
|||
using System; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usings?
@@ -259,6 +259,9 @@ public bool IsNavBarEnabled() | |||
public TextSpan[] GetKeywordHighlightTags() | |||
=> Deserialize(_editorInProc.GetHighlightTags()); | |||
|
|||
public TextSpan[] GetOutliningSpans() | |||
=> Deserialize(_editorInProc.GetOutliningSpans()); | |||
|
|||
private TextSpan[] Deserialize(string[] v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DeserializeTags
?
}|]"; | ||
MarkupTestFile.GetSpans(input, out var text, out ImmutableArray<TextSpan> spans); | ||
VisualStudio.Editor.SetText(text); | ||
VisualStudio.Workspace.WaitForAsyncOperations(FeatureAttribute.Outlining); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No direct waits in tests; the wait should be moved to .GetOutliningSpans().
762068a
to
eec4687
Compare
tag @dotnet/roslyn-ide for review