diff --git a/src/EditorFeatures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs b/src/EditorFeatures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs index cf4965cb04230..a34d290db12fd 100644 --- a/src/EditorFeatures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs +++ b/src/EditorFeatures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs @@ -5015,5 +5015,23 @@ void S() ", MainDescription("T Test.F()")); } + + + [Fact, Trait(Traits.Feature, Traits.Features.QuickInfo)] + [WorkItem(403665, "https://devdiv.visualstudio.com/DevDiv/_workitems?id=403665&_a=edit")] + public async Task TestExceptionWithCrefToConstructorDoesNotCrash() + { + await TestAsync( +@" +class Test +{ + /// + /// + /// + public Test$$() {} +} +", + MainDescription("Test.Test()")); + } } } diff --git a/src/Features/Core/Portable/DocumentationComments/AbstractDocumentationCommentFormattingService.cs b/src/Features/Core/Portable/DocumentationComments/AbstractDocumentationCommentFormattingService.cs index cadb6736e6fa6..0a76657c24b05 100644 --- a/src/Features/Core/Portable/DocumentationComments/AbstractDocumentationCommentFormattingService.cs +++ b/src/Features/Core/Portable/DocumentationComments/AbstractDocumentationCommentFormattingService.cs @@ -213,6 +213,7 @@ internal static IEnumerable CrefToSymbolDisplayParts( var symbol = DocumentationCommentId.GetFirstSymbolForDeclarationId(crefValue, semanticModel.Compilation); if (symbol != null) { + format = format ?? SymbolDisplayFormat.MinimallyQualifiedFormat; if (symbol.IsConstructor()) { format = format.WithMemberOptions(SymbolDisplayMemberOptions.IncludeParameters | SymbolDisplayMemberOptions.IncludeExplicitInterface);