mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Declaration emit for NamedImport syntax
This commit is contained in:
@@ -4912,7 +4912,13 @@ module ts {
|
||||
getSymbolLinks(rightSide).referenced = true;
|
||||
Debug.assert((rightSide.flags & SymbolFlags.Import) !== 0);
|
||||
|
||||
nodeLinks = getNodeLinks(getDeclarationOfKind(rightSide, SyntaxKind.ImportEqualsDeclaration))
|
||||
var importEqualsDeclaration = getDeclarationOfKind(rightSide, SyntaxKind.ImportEqualsDeclaration);
|
||||
if (importEqualsDeclaration) {
|
||||
nodeLinks = getNodeLinks(importEqualsDeclaration);
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -780,6 +780,11 @@ module ts {
|
||||
writeTextOfNode(currentSourceFile,(<NamespaceImport>node.importClause.namedBindings).name);
|
||||
write(" ");
|
||||
}
|
||||
else {
|
||||
write("{");
|
||||
emitCommaList((<NamedImports>node.importClause.namedBindings).elements, emitImportSpecifier);
|
||||
write(" } ");
|
||||
}
|
||||
}
|
||||
write("from ");
|
||||
}
|
||||
@@ -788,6 +793,15 @@ module ts {
|
||||
writer.writeLine();
|
||||
}
|
||||
|
||||
function emitImportSpecifier(node: ImportSpecifier) {
|
||||
write(" ");
|
||||
if (node.propertyName) {
|
||||
writeTextOfNode(currentSourceFile, node.propertyName);
|
||||
write(" as ");
|
||||
}
|
||||
writeTextOfNode(currentSourceFile, node.name);
|
||||
}
|
||||
|
||||
function emitModuleDeclaration(node: ModuleDeclaration) {
|
||||
if (resolver.isDeclarationVisible(node)) {
|
||||
emitJsDocComments(node);
|
||||
|
||||
Reference in New Issue
Block a user