mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
findAllRefs: Fix bug for export not at top-level of a module/namespace (#21846)
This commit is contained in:
@@ -606,7 +606,9 @@ namespace ts.FindAllReferences {
|
||||
}
|
||||
|
||||
export function getExportInfo(exportSymbol: Symbol, exportKind: ExportKind, checker: TypeChecker): ExportInfo | undefined {
|
||||
const exportingModuleSymbol = checker.getMergedSymbol(exportSymbol.parent); // Need to get merged symbol in case there's an augmentation.
|
||||
const moduleSymbol = exportSymbol.parent;
|
||||
if (!moduleSymbol) return undefined; // This can happen if an `export` is not at the top-level (which is a compile error).
|
||||
const exportingModuleSymbol = checker.getMergedSymbol(moduleSymbol); // Need to get merged symbol in case there's an augmentation.
|
||||
// `export` may appear in a namespace. In that case, just rely on global search.
|
||||
return isExternalModuleSymbol(exportingModuleSymbol) ? { exportingModuleSymbol, exportKind } : undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user