mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 22:51:17 -05:00
Clean up isNameOfExternalModuleImportOrDeclaration (#22659)
This commit is contained in:
@@ -772,9 +772,11 @@ namespace ts.FindAllReferences.Core {
|
||||
case SyntaxKind.Identifier:
|
||||
return (node as Identifier).text.length === searchSymbolName.length;
|
||||
|
||||
case SyntaxKind.StringLiteral:
|
||||
return (isLiteralNameOfPropertyDeclarationOrIndexAccess(node as StringLiteral) || isNameOfExternalModuleImportOrDeclaration(node)) &&
|
||||
(node as StringLiteral).text.length === searchSymbolName.length;
|
||||
case SyntaxKind.StringLiteral: {
|
||||
const str = node as StringLiteral;
|
||||
return (isLiteralNameOfPropertyDeclarationOrIndexAccess(str) || isNameOfModuleDeclaration(node) || isExpressionOfExternalModuleImportEqualsDeclaration(node)) &&
|
||||
str.text.length === searchSymbolName.length;
|
||||
}
|
||||
|
||||
case SyntaxKind.NumericLiteral:
|
||||
return isLiteralNameOfPropertyDeclarationOrIndexAccess(node as NumericLiteral) && (node as NumericLiteral).text.length === searchSymbolName.length;
|
||||
@@ -1735,14 +1737,6 @@ namespace ts.FindAllReferences.Core {
|
||||
return tryGetClassExtendingExpressionWithTypeArguments(climbPastPropertyAccess(node).parent);
|
||||
}
|
||||
|
||||
function isNameOfExternalModuleImportOrDeclaration(node: Node): boolean {
|
||||
if (node.kind === SyntaxKind.StringLiteral) {
|
||||
return isNameOfModuleDeclaration(node) || isExpressionOfExternalModuleImportEqualsDeclaration(node);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* If we are just looking for implementations and this is a property access expression, we need to get the
|
||||
* symbol of the local type of the symbol the property is being accessed on. This is because our search
|
||||
|
||||
Reference in New Issue
Block a user