Skip to content

Commit 3e040cc

Browse files
Fix find refs
1 parent 2bfa8f4 commit 3e040cc

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/EditorFeatures/Test2/FindReferences/FindReferencesTests.ExtensionSymbols.vb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public static class MyExtension
118118
{
119119
extension(string $${|Definition:s|})
120120
{
121-
public static int ExtensionMethod()
121+
public int ExtensionMethod()
122122
{
123123
return [|s|].Length;
124124
}
@@ -143,9 +143,9 @@ public static class MyExtension
143143
{
144144
extension<$${|Definition:T|}>(string s)
145145
{
146-
public static int ExtensionMethod([|T|] t)
146+
public int ExtensionMethod([|T|] t)
147147
{
148-
return [|s|].Length;
148+
return s.Length;
149149
}
150150
}
151151
}

src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/TypeParameterSymbolReferenceFinder.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ protected override Task DetermineDocumentsToSearchAsync<TData>(
3232
// parameter has a different name in different parts that we won't find it. However,
3333
// this only happens in error situations. It is not legal in C# to use a different
3434
// name for a type parameter in different parts.
35-
return FindDocumentsAsync(project, documents, processResult, processResultData, cancellationToken, symbol.Name, symbol.ContainingType.Name);
35+
return symbol.ContainingType is { IsExtension: true, ContainingType.Name: var staticClassName }
36+
? FindDocumentsAsync(project, documents, processResult, processResultData, cancellationToken, symbol.Name, staticClassName)
37+
: FindDocumentsAsync(project, documents, processResult, processResultData, cancellationToken, symbol.Name, symbol.ContainingType.Name);
3638
}
3739
}

0 commit comments

Comments
 (0)