diff --git a/src/language/typescript/monaco.contribution.ts b/src/language/typescript/monaco.contribution.ts index d018902136..d272f375fa 100644 --- a/src/language/typescript/monaco.contribution.ts +++ b/src/language/typescript/monaco.contribution.ts @@ -522,7 +522,11 @@ export interface TypeScriptWorker { * Get transpiled output for the given file. * @returns `typescript.EmitOutput` */ - getEmitOutput(fileName: string): Promise; + getEmitOutput( + fileName: string, + emitOnlyDtsFiles?: boolean, + forceDtsEmit?: boolean + ): Promise; /** * Get possible code fixes at the given position in the file. diff --git a/src/language/typescript/tsWorker.ts b/src/language/typescript/tsWorker.ts index 4ffc8867dc..c4f7d3eba0 100644 --- a/src/language/typescript/tsWorker.ts +++ b/src/language/typescript/tsWorker.ts @@ -402,12 +402,20 @@ export class TypeScriptWorker implements ts.LanguageServiceHost, ITypeScriptWork return this._languageService.getRenameInfo(fileName, position, options); } - async getEmitOutput(fileName: string): Promise { + async getEmitOutput( + fileName: string, + emitOnlyDtsFiles?: boolean, + forceDtsEmit?: boolean + ): Promise { if (fileNameIsLib(fileName)) { return { outputFiles: [], emitSkipped: true }; } // The diagnostics property is internal, returning it without clearing breaks message serialization. - const emitOutput = this._languageService.getEmitOutput(fileName) as ts.EmitOutput & { + const emitOutput = this._languageService.getEmitOutput( + fileName, + emitOnlyDtsFiles, + forceDtsEmit + ) as ts.EmitOutput & { diagnostics?: ts.Diagnostic[]; }; const diagnostics = emitOutput.diagnostics