File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1428,6 +1428,10 @@ namespace ts.FindAllReferences.Core {
1428
1428
return [ { definition : { type : DefinitionKind . Symbol , symbol : searchSpaceNode . symbol } , references } ] ;
1429
1429
}
1430
1430
1431
+ function isParameterName ( node : Node ) {
1432
+ return node . kind === SyntaxKind . Identifier && node . parent . kind === SyntaxKind . Parameter && ( < ParameterDeclaration > node . parent ) . name === node ;
1433
+ }
1434
+
1431
1435
function getReferencesForThisKeyword ( thisOrSuperKeyword : Node , sourceFiles : ReadonlyArray < SourceFile > , cancellationToken : CancellationToken ) : SymbolAndEntries [ ] | undefined {
1432
1436
let searchSpaceNode = getThisContainer ( thisOrSuperKeyword , /* includeArrowFunctions */ false ) ;
1433
1437
@@ -1450,7 +1454,7 @@ namespace ts.FindAllReferences.Core {
1450
1454
searchSpaceNode = searchSpaceNode . parent ; // re-assign to be the owning class
1451
1455
break ;
1452
1456
case SyntaxKind . SourceFile :
1453
- if ( isExternalModule ( < SourceFile > searchSpaceNode ) ) {
1457
+ if ( isExternalModule ( < SourceFile > searchSpaceNode ) || isParameterName ( thisOrSuperKeyword ) ) {
1454
1458
return undefined ;
1455
1459
}
1456
1460
// falls through
@@ -1483,7 +1487,7 @@ namespace ts.FindAllReferences.Core {
1483
1487
// and has the appropriate static modifier from the original container.
1484
1488
return container . parent && searchSpaceNode . symbol === container . parent . symbol && ( getModifierFlags ( container ) & ModifierFlags . Static ) === staticFlag ;
1485
1489
case SyntaxKind . SourceFile :
1486
- return container . kind === SyntaxKind . SourceFile && ! isExternalModule ( < SourceFile > container ) ;
1490
+ return container . kind === SyntaxKind . SourceFile && ! isExternalModule ( < SourceFile > container ) && ! isParameterName ( node ) ;
1487
1491
}
1488
1492
} ) ;
1489
1493
} ) . map ( n => nodeEntry ( n ) ) ;
You can’t perform that action at this time.
0 commit comments