Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'editors/code/src/toolchain.ts')
| -rw-r--r-- | editors/code/src/toolchain.ts | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/editors/code/src/toolchain.ts b/editors/code/src/toolchain.ts index e8bab9c3d8..bb06144295 100644 --- a/editors/code/src/toolchain.ts +++ b/editors/code/src/toolchain.ts @@ -18,6 +18,22 @@ export interface ArtifactSpec { filter?: (artifacts: CompilationArtifact[]) => CompilationArtifact[]; } +interface CompilerMessage { + reason: string; + executable?: string; + target: { + crate_types: [string, ...string[]]; + kind: [string, ...string[]]; + name: string; + }; + profile: { + test: boolean; + }; + message: { + rendered: string; + }; +} + export class Cargo { constructor( readonly rootFolder: string, @@ -109,7 +125,7 @@ export class Cargo { private async runCargo( cargoArgs: string[], - onStdoutJson: (obj: any) => void, + onStdoutJson: (obj: CompilerMessage) => void, onStderrString: (data: string) => void, env?: Record<string, string>, ): Promise<number> { @@ -131,7 +147,7 @@ export class Cargo { onStdoutJson(message); }); - cargo.on("exit", (exitCode, _) => { + cargo.on("exit", (exitCode) => { if (exitCode === 0) resolve(exitCode); else reject(new Error(`exit code: ${exitCode}.`)); }); |