Skip to content

Commit

Permalink
Merge pull request #21815 from rchande/crefCrash
Browse files Browse the repository at this point in the history
Fix documentation comment watson
  • Loading branch information
Ravi Chande authored Aug 30, 2017
2 parents ad062ce + 80bd4f5 commit b4ca401
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5015,5 +5015,23 @@ void S()
",
MainDescription("T Test.F<T>()"));
}


[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
{
/// <summary>
/// </summary>
/// <exception cref=""Test.Test""/>
public Test$$() {}
}
",
MainDescription("Test.Test()"));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ internal static IEnumerable<SymbolDisplayPart> 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);
Expand Down

0 comments on commit b4ca401

Please sign in to comment.