mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 07:29:16 -05: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:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user