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

View File

@@ -67,6 +67,11 @@ namespace ts {
* Gets test data for source maps.
*/
getSourceMapData(): SourceMapData;
/**
* @returns the previous disabled state
*/
setState(disabled: boolean): boolean;
}
// Used for initialize lastEncodedSourceMapSpan and reset lastEncodedSourceMapSpan when updateLastEncodedAndRecordedSpans
@@ -107,8 +112,15 @@ namespace ts {
emitTokenWithSourceMap,
getText,
getSourceMappingURL,
setState,
};
function setState(state: boolean) {
const last = disabled;
disabled = state;
return last;
}
/**
* Skips trivia such as comments and white-space that can optionally overriden by the source map source
*/