@@ -257,14 +257,14 @@ namespace ts {
257257 getSyntacticDiagnostics : ( sourceFile , cancellationToken ) => state . program . getSyntacticDiagnostics ( sourceFile , cancellationToken ) ,
258258 getSemanticDiagnostics,
259259 emit,
260- getAllDependencies : sourceFile => BuilderState . getAllDependencies ( state , state . program , sourceFile )
260+ getAllDependencies : sourceFile => BuilderState . getAllDependencies ( state , state . program , sourceFile ) ,
261+ getCurrentDirectory : ( ) => state . program . getCurrentDirectory ( )
261262 } ;
262263
263264 if ( kind === BuilderProgramKind . SemanticDiagnosticsBuilderProgram ) {
264265 ( result as SemanticDiagnosticsBuilderProgram ) . getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile ;
265266 }
266267 else if ( kind === BuilderProgramKind . EmitAndSemanticDiagnosticsBuilderProgram ) {
267- ( result as EmitAndSemanticDiagnosticsBuilderProgram ) . getCurrentDirectory = ( ) => state . program . getCurrentDirectory ( ) ;
268268 ( result as EmitAndSemanticDiagnosticsBuilderProgram ) . emitNextAffectedFile = emitNextAffectedFile ;
269269 }
270270 else {
@@ -485,6 +485,10 @@ namespace ts {
485485 * in that order would be used to write the files
486486 */
487487 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 ;
488492 }
489493
490494 /**
@@ -503,10 +507,6 @@ namespace ts {
503507 * The semantic diagnostics are cached per file and managed by clearing for the changed/affected files
504508 */
505509 export interface EmitAndSemanticDiagnosticsBuilderProgram extends BuilderProgram {
506- /**
507- * Get the current directory of the program
508- */
509- getCurrentDirectory ( ) : string ;
510510 /**
511511 * Emits the next affected file's emit result (EmitResult and sourceFiles emitted) or returns undefined if iteration is complete
512512 * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host
0 commit comments