mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
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:
@@ -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);
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user