Skip to content

Commit a297a28

Browse files
author
Andy
authored
Use getPossibleSymbolReferenceNodes in one more place (microsoft#23378)
1 parent 23ed9f8 commit a297a28

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/services/findAllReferences.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,9 +704,8 @@ namespace ts.FindAllReferences.Core {
704704
export function isSymbolReferencedInFile(definition: Identifier, checker: TypeChecker, sourceFile: SourceFile) {
705705
const symbol = checker.getSymbolAtLocation(definition);
706706
if (!symbol) return true; // Be lenient with invalid code.
707-
return getPossibleSymbolReferencePositions(sourceFile, symbol.name).some(position => {
708-
const token = tryCast(getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true), isIdentifier);
709-
if (!token || token === definition || token.escapedText !== definition.escapedText) return false;
707+
return getPossibleSymbolReferenceNodes(sourceFile, symbol.name).some(token => {
708+
if (!isIdentifier(token) || token === definition || token.escapedText !== definition.escapedText) return false;
710709
const referenceSymbol = checker.getSymbolAtLocation(token);
711710
return referenceSymbol === symbol
712711
|| checker.getShorthandAssignmentValueSymbol(token.parent) === symbol

0 commit comments

Comments
 (0)