fix(41740): disallow renaming/exclude from references default keyword (#41947)

This commit is contained in:
Oleksandr T
2021-02-17 17:07:31 -08:00
committed by GitHub
parent 20ce292484
commit 7fca9267e6
4 changed files with 128 additions and 1 deletions
+1 -1
View File
@@ -921,7 +921,7 @@ namespace ts.FindAllReferences {
// When renaming at an export specifier, rename the export and not the thing being exported.
getReferencesAtExportSpecifier(exportSpecifier.name, symbol, exportSpecifier, state.createSearch(node, originalSymbol, /*comingFrom*/ undefined), state, /*addReferencesHere*/ true, /*alwaysGetReferences*/ true);
}
else if (node && node.kind === SyntaxKind.DefaultKeyword) {
else if (node && node.kind === SyntaxKind.DefaultKeyword && symbol.escapedName === InternalSymbolName.Default) {
addReference(node, symbol, state);
searchForImportsOfExport(node, symbol, { exportingModuleSymbol: Debug.checkDefined(symbol.parent, "Expected export symbol to have a parent"), exportKind: ExportKind.Default }, state);
}