mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
This commit is contained in:
co-authored by
Mateusz Burzyński
parent
f35206d202
commit
a44e2d925c
@@ -902,6 +902,12 @@ export function tryGetAutoImportableReferenceFromTypeNode(importTypeNode: TypeNo
|
||||
if (isLiteralImportTypeNode(node) && node.qualifier) {
|
||||
// Symbol for the left-most thing after the dot
|
||||
const firstIdentifier = getFirstIdentifier(node.qualifier);
|
||||
if (!firstIdentifier.symbol) {
|
||||
// if symbol is missing then this doesn't come from a synthesized import type node
|
||||
// it has to be an import type node authored by the user and thus it has to be valid
|
||||
// it can't refer to reserved internal symbol names and such
|
||||
return visitEachChild(node, visit, /*context*/ undefined);
|
||||
}
|
||||
const name = getNameForExportedSymbol(firstIdentifier.symbol, scriptTarget);
|
||||
const qualifier = name !== firstIdentifier.text
|
||||
? replaceFirstIdentifierOfEntityName(node.qualifier, factory.createIdentifier(name))
|
||||
|
||||
Reference in New Issue
Block a user