Emit amd-module and amd-dependency comments in emitter if printing declaration comments (#22740)

* Emit amd-module and amd-dependency comments in emitter if printing declaration comments

* Move code a bit

* Move again
This commit is contained in:
Wesley Wigham
2018-03-29 13:43:31 -07:00
committed by GitHub
parent 509a53fea7
commit 43a482f03f
5 changed files with 101 additions and 0 deletions

View File

@@ -2481,6 +2481,21 @@ namespace ts {
}
function emitTripleSlashDirectives(files: ReadonlyArray<FileReference>, types: ReadonlyArray<FileReference>) {
if (currentSourceFile && currentSourceFile.moduleName) {
write(`/// <amd-module name="${currentSourceFile.moduleName}" />`);
writeLine();
}
if (currentSourceFile && currentSourceFile.amdDependencies) {
for (const dep of currentSourceFile.amdDependencies) {
if (dep.name) {
write(`/// <amd-dependency name="${dep.name}" path="${dep.path}" />`);
}
else {
write(`/// <amd-dependency path="${dep.path}" />`);
}
writeLine();
}
}
for (const directive of files) {
write(`/// <reference path="${directive.fileName}" />`);
writeLine();