Skip to content

Commit

Permalink
Pass args down too
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey committed Apr 25, 2024
1 parent 5a8eb62 commit 7be409e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/language/typescript/monaco.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,11 @@ export interface TypeScriptWorker {
* Get transpiled output for the given file.
* @returns `typescript.EmitOutput`
*/
getEmitOutput(fileName: string): Promise<EmitOutput>;
getEmitOutput(
fileName: string,
emitOnlyDtsFiles?: boolean,
forceDtsEmit?: boolean
): Promise<EmitOutput>;

/**
* Get possible code fixes at the given position in the file.
Expand Down
12 changes: 10 additions & 2 deletions src/language/typescript/tsWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,12 +402,20 @@ export class TypeScriptWorker implements ts.LanguageServiceHost, ITypeScriptWork
return this._languageService.getRenameInfo(fileName, position, options);
}

async getEmitOutput(fileName: string): Promise<EmitOutput> {
async getEmitOutput(
fileName: string,
emitOnlyDtsFiles?: boolean,
forceDtsEmit?: boolean
): Promise<EmitOutput> {
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
Expand Down

0 comments on commit 7be409e

Please sign in to comment.