Skip to content

Commit

Permalink
Merge pull request #69930 from sharwell/add-quickinfo-test
Browse files Browse the repository at this point in the history
Add Quick Info test for 'see cref'
  • Loading branch information
sharwell authored Sep 14, 2023
2 parents 7c46948 + 0612b27 commit 984b31e
Showing 1 changed file with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,50 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.IntelliSense

ToolTipAssert.EqualContent(expected, intellisenseQuickInfo.Item)
End Function

<WpfFact>
Public Async Function QuickInfoForBuiltInTypeReference() As Task
Dim workspace =
<Workspace>
<Project Language="C#" CommonReferences="true">
<Document>
using System.Threading;
class MyClass {
/// &lt;summary&gt;
/// This contains a link to &lt;see cref="string"/&gt;.
/// &lt;/summary&gt;
void MyMethod() {
MyM$$ethod();
}
}
</Document>
</Project>
</Workspace>

Dim intellisenseQuickInfo = Await GetQuickInfoItemAsync(workspace, LanguageNames.CSharp)

Dim expected = New ContainerElement(
ContainerElementStyle.Stacked Or ContainerElementStyle.VerticalPadding,
New ContainerElement(
ContainerElementStyle.Stacked,
New ContainerElement(
ContainerElementStyle.Wrapped,
New ImageElement(New ImageId(KnownImageIds.ImageCatalogGuid, KnownImageIds.MethodPrivate)),
New ClassifiedTextElement(
New ClassifiedTextRun(ClassificationTypeNames.Keyword, "void"),
New ClassifiedTextRun(ClassificationTypeNames.WhiteSpace, " "),
New ClassifiedTextRun(ClassificationTypeNames.ClassName, "MyClass", navigationAction:=Sub() Return, "MyClass"),
New ClassifiedTextRun(ClassificationTypeNames.Punctuation, "."),
New ClassifiedTextRun(ClassificationTypeNames.MethodName, "MyMethod", navigationAction:=Sub() Return, "void MyClass.MyMethod()"),
New ClassifiedTextRun(ClassificationTypeNames.Punctuation, "("),
New ClassifiedTextRun(ClassificationTypeNames.Punctuation, ")"))),
New ClassifiedTextElement(
New ClassifiedTextRun(ClassificationTypeNames.Text, "This contains a link to"),
New ClassifiedTextRun(ClassificationTypeNames.WhiteSpace, " "),
New ClassifiedTextRun(ClassificationTypeNames.Keyword, "string", navigationAction:=Sub() Return, "string"),
New ClassifiedTextRun(ClassificationTypeNames.Text, "."))))

ToolTipAssert.EqualContent(expected, intellisenseQuickInfo.Item)
End Function
End Class
End Namespace

0 comments on commit 984b31e

Please sign in to comment.