Refactor declaration emitter into declaration transformer (#21930)

* Refactor declaration emitter into declaration transformer

* Slight cleanup from code review feedback

* Incorporate fix for new test

* Swaths of PR feedback

* Merge public methods

* Per-file output

* Preserve input import ordering more often

* Unify jsdoc comment start detection under more lenient rule

* Move to per-file transformations to reduce the memory that msut be retained

* Fix typo
This commit is contained in:
Wesley Wigham
2018-03-15 22:23:10 -07:00
committed by GitHub
parent 162a273e43
commit 19ec83fcdf
124 changed files with 2656 additions and 2729 deletions
+1 -1
View File
@@ -874,7 +874,7 @@ namespace ts.textChanges {
let ranges = getLeadingCommentRanges(text, position);
if (!ranges) return position;
// However we should still skip a pinned comment at the top
if (ranges.length && ranges[0].kind === SyntaxKind.MultiLineCommentTrivia && isPinnedComment(text, ranges[0])) {
if (ranges.length && ranges[0].kind === SyntaxKind.MultiLineCommentTrivia && isPinnedComment(text, ranges[0].pos)) {
position = ranges[0].end;
advancePastLineBreak();
ranges = ranges.slice(1);
+2 -1
View File
@@ -31,10 +31,11 @@
"../compiler/transformers/module/module.ts",
"../compiler/transformers/module/system.ts",
"../compiler/transformers/module/es2015.ts",
"../compiler/transformers/declarations/diagnostics.ts",
"../compiler/transformers/declarations.ts",
"../compiler/transformer.ts",
"../compiler/comments.ts",
"../compiler/sourcemap.ts",
"../compiler/declarationEmitter.ts",
"../compiler/emitter.ts",
"../compiler/program.ts",
"../compiler/builderState.ts",