Fixes searches for export * as 'identifier' (#39533)

* Fixes searches for export * as 'identifier'
Fixes #39006

* Fix the context span to export declaration (was incorrectly set to sourceFile in prev commit)
This commit is contained in:
Sheetal Nandi
2020-07-09 13:45:43 -07:00
committed by GitHub
parent bf1ea6508b
commit b397d1fd4a
4 changed files with 15 additions and 7 deletions

View File

@@ -132,6 +132,7 @@ namespace ts.FindAllReferences {
return node.parent.parent;
case SyntaxKind.ImportClause:
case SyntaxKind.NamespaceExport:
return node.parent;
case SyntaxKind.BinaryExpression:

View File

@@ -481,6 +481,9 @@ namespace ts.FindAllReferences {
return exportInfo(symbol, getExportKindForDeclaration(exportNode));
}
}
else if (isNamespaceExport(parent)) {
return exportInfo(symbol, ExportKind.Named);
}
// If we are in `export = a;` or `export default a;`, `parent` is the export assignment.
else if (isExportAssignment(parent)) {
return getExportAssignmentExport(parent);