@@ -257,14 +257,14 @@ namespace ts {
257
257
getSyntacticDiagnostics : ( sourceFile , cancellationToken ) => state . program . getSyntacticDiagnostics ( sourceFile , cancellationToken ) ,
258
258
getSemanticDiagnostics,
259
259
emit,
260
- getAllDependencies : sourceFile => BuilderState . getAllDependencies ( state , state . program , sourceFile )
260
+ getAllDependencies : sourceFile => BuilderState . getAllDependencies ( state , state . program , sourceFile ) ,
261
+ getCurrentDirectory : ( ) => state . program . getCurrentDirectory ( )
261
262
} ;
262
263
263
264
if ( kind === BuilderProgramKind . SemanticDiagnosticsBuilderProgram ) {
264
265
( result as SemanticDiagnosticsBuilderProgram ) . getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile ;
265
266
}
266
267
else if ( kind === BuilderProgramKind . EmitAndSemanticDiagnosticsBuilderProgram ) {
267
- ( result as EmitAndSemanticDiagnosticsBuilderProgram ) . getCurrentDirectory = ( ) => state . program . getCurrentDirectory ( ) ;
268
268
( result as EmitAndSemanticDiagnosticsBuilderProgram ) . emitNextAffectedFile = emitNextAffectedFile ;
269
269
}
270
270
else {
@@ -485,6 +485,10 @@ namespace ts {
485
485
* in that order would be used to write the files
486
486
*/
487
487
emit ( targetSourceFile ?: SourceFile , writeFile ?: WriteFileCallback , cancellationToken ?: CancellationToken , emitOnlyDtsFiles ?: boolean , customTransformers ?: CustomTransformers ) : EmitResult ;
488
+ /**
489
+ * Get the current directory of the program
490
+ */
491
+ getCurrentDirectory ( ) : string ;
488
492
}
489
493
490
494
/**
@@ -503,10 +507,6 @@ namespace ts {
503
507
* The semantic diagnostics are cached per file and managed by clearing for the changed/affected files
504
508
*/
505
509
export interface EmitAndSemanticDiagnosticsBuilderProgram extends BuilderProgram {
506
- /**
507
- * Get the current directory of the program
508
- */
509
- getCurrentDirectory ( ) : string ;
510
510
/**
511
511
* Emits the next affected file's emit result (EmitResult and sourceFiles emitted) or returns undefined if iteration is complete
512
512
* The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host
0 commit comments