diff --git a/src/EditorFeatures/Test2/FindReferences/FindReferencesTests.AccessorSymbols.vb b/src/EditorFeatures/Test2/FindReferences/FindReferencesTests.AccessorSymbols.vb index 59b24174c7c0f46b60285908bb813718723fba11..ca173d333f7086eba07d511318075fa1c6bb796d 100644 --- a/src/EditorFeatures/Test2/FindReferences/FindReferencesTests.AccessorSymbols.vb +++ b/src/EditorFeatures/Test2/FindReferences/FindReferencesTests.AccessorSymbols.vb @@ -895,6 +895,40 @@ class D Await TestStreamingFeature(input) End Function + + Public Async Function TestCSharpAccessor_Get_Cref() As Task + Dim input = + + + +interface IC +{ + /// <see cref="Prop"/> + int Prop { {|Definition:$$get|}; set; } +} + + + + Await TestStreamingFeature(input) + End Function + + + Public Async Function TestCSharpAccessor_Set_Cref() As Task + Dim input = + + + +interface IC +{ + /// <see cref="Prop"/> + int Prop { get; {|Definition:$$set|}; } +} + + + + Await TestStreamingFeature(input) + End Function + Public Async Function TestVBAccessor_Get_Feature1() As Task Dim input = diff --git a/src/EditorFeatures/Test2/FindReferences/FindReferencesTests.PropertySymbols.vb b/src/EditorFeatures/Test2/FindReferences/FindReferencesTests.PropertySymbols.vb index a80726e404572c5cb3e84d6e7bc78a6063ab2b54..3021f37d24517bbd60b8b5a1fe433093d8623775 100644 --- a/src/EditorFeatures/Test2/FindReferences/FindReferencesTests.PropertySymbols.vb +++ b/src/EditorFeatures/Test2/FindReferences/FindReferencesTests.PropertySymbols.vb @@ -893,5 +893,22 @@ End Class Await TestAPIAndFeature(input) End Function + + + Public Async Function TestCSharpProperty_Cref() As Task + Dim input = + + + +interface IC +{ + /// <see cref="[|Prop|]"/> + int {|Definition:$$Prop|} { get; set; } +} + + + + Await TestStreamingFeature(input) + End Function End Class End Namespace diff --git a/src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/AbstractMethodOrPropertyOrEventSymbolReferenceFinder.cs b/src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/AbstractMethodOrPropertyOrEventSymbolReferenceFinder.cs index c27af698e013b52c2acd55420d0157eb5659a046..9543df26786dcf9c0dd41f88057a978f07f2a9ce 100644 --- a/src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/AbstractMethodOrPropertyOrEventSymbolReferenceFinder.cs +++ b/src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/AbstractMethodOrPropertyOrEventSymbolReferenceFinder.cs @@ -81,9 +81,18 @@ protected AbstractMethodOrPropertyOrEventSymbolReferenceFinder() } else { - // Wasn't written. This could be a normal read, or used through something - // like nameof(). - return semanticFacts.IsInsideNameOfExpression(model, node, cancellationToken) + // Wasn't written. This could be a normal read, or it could be neither a read nor + // write. Example of this include: + // + // 1) referencing through something like nameof(). + // 2) referencing in a cref in a doc-comment. + // + // This list is thought to be complete. However, if new examples are found, they + // can be added here. + var inNameOf = semanticFacts.IsInsideNameOfExpression(model, node, cancellationToken); + var inStructuredTrivia = node.IsPartOfStructuredTrivia(); + + return inNameOf || inStructuredTrivia ? ImmutableArray.Empty : ImmutableArray.Create(property.GetMethod); }