From dc278f53d08d78b3d2a38a62656aa7d201cc8465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9di-R=C3=A9mi=20Hashim?= Date: Wed, 24 Dec 2025 20:53:16 +0100 Subject: [PATCH 1/3] Promisify'd child_process.execFile throws if exit code is non-zero --- server/src/incrementalCompilation.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/src/incrementalCompilation.ts b/server/src/incrementalCompilation.ts index 1cc4e1ce8..14dddc498 100644 --- a/server/src/incrementalCompilation.ts +++ b/server/src/incrementalCompilation.ts @@ -712,7 +712,12 @@ async function compileContents( entry.project.bscBinaryLocation, callArgs, { cwd, signal }, - ); + ).catch((error) => { + if (error.stderr) { + return { stderr: error.stderr }; + } + throw error; + }); getLogger().log( `Recompiled ${entry.file.sourceFileName} in ${ From e9d5071a80d9e92db004f911edf62c2c3d89dae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9di-R=C3=A9mi=20Hashim?= Date: Wed, 24 Dec 2025 20:53:31 +0100 Subject: [PATCH 2/3] Remove unused import --- server/src/incrementalCompilation.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/server/src/incrementalCompilation.ts b/server/src/incrementalCompilation.ts index 14dddc498..da65b9d4d 100644 --- a/server/src/incrementalCompilation.ts +++ b/server/src/incrementalCompilation.ts @@ -13,7 +13,6 @@ import { fileCodeActions } from "./codeActions"; import { projectsFiles } from "./projectFiles"; import { getRewatchBscArgs, RewatchCompilerArgs } from "./bsc-args/rewatch"; import { BsbCompilerArgs, getBsbBscArgs } from "./bsc-args/bsb"; -import { getCurrentCompilerDiagnosticsForFile } from "./server"; import { NormalizedPath } from "./utils"; import { getLogger } from "./logger"; From cacee028ec961bd49645bfa07589cd186557c245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9di-R=C3=A9mi=20Hashim?= Date: Wed, 24 Dec 2025 21:04:00 +0100 Subject: [PATCH 3/3] Add CHANGELOG entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 650bed246..3e095205f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - Take namespace into account for incremental cleanup. https://github.com/rescript-lang/rescript-vscode/pull/1164 - Potential race condition in incremental compilation. https://github.com/rescript-lang/rescript-vscode/pull/1167 +- Fix extension crash triggered by incremental compilation. https://github.com/rescript-lang/rescript-vscode/pull/1169 #### :nail_care: Polish