From 696c79245888af9c09245f06d43fd4289e3c05e3 Mon Sep 17 00:00:00 2001 From: nojaf Date: Thu, 2 Oct 2025 09:03:32 +0200 Subject: [PATCH 1/3] Find other binaries via compiler-info.json --- server/src/utils.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/src/utils.ts b/server/src/utils.ts index 3d44ccd5c..c64dbcc57 100644 --- a/server/src/utils.ts +++ b/server/src/utils.ts @@ -92,7 +92,7 @@ let findBinary = async ( return path.join(config.extensionConfiguration.platformPath, binary); } - if (projectRootPath !== null && binary === "bsc.exe") { + if (projectRootPath !== null) { try { const compilerInfo = path.resolve( projectRootPath, @@ -101,7 +101,13 @@ let findBinary = async ( const contents = await fsAsync.readFile(compilerInfo, "utf8"); const compileInfo = JSON.parse(contents); if (compileInfo && compileInfo.bsc_path) { - return compileInfo.bsc_path; + const bsc_path = compileInfo.bsc_path; + if (binary === "bsc.exe") { + return bsc_path; + } else { + const binary_path = path.join(path.dirname(bsc_path), binary); + return binary_path; + } } } catch {} } From dd5003c1feb91b9d4f3294991502b2d93fbb6f77 Mon Sep 17 00:00:00 2001 From: nojaf Date: Thu, 2 Oct 2025 09:03:55 +0200 Subject: [PATCH 2/3] Look for lock file in workspace folders --- server/src/incrementalCompilation.ts | 7 +++++++ server/src/server.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/server/src/incrementalCompilation.ts b/server/src/incrementalCompilation.ts index 50be4f526..4b90178f4 100644 --- a/server/src/incrementalCompilation.ts +++ b/server/src/incrementalCompilation.ts @@ -14,6 +14,7 @@ import { fileCodeActions } from "./codeActions"; import { projectsFiles } from "./projectFiles"; import { getRewatchBscArgs, RewatchCompilerArgs } from "./bsc-args/rewatch"; import { BsbCompilerArgs, getBsbBscArgs } from "./bsc-args/bsb"; +import { workspaceFolders } from "./server"; export function debug() { return ( @@ -262,6 +263,12 @@ function triggerIncrementalCompilationOfFile( } const projectRewatchLockfiles = [ + ...Array.from(workspaceFolders).map((w) => + path.resolve(w, c.rewatchLockPartialPath), + ), + ...Array.from(workspaceFolders).map((w) => + path.resolve(w, c.rescriptLockPartialPath), + ), path.resolve(projectRootPath, c.rewatchLockPartialPath), path.resolve(projectRootPath, c.rescriptLockPartialPath), ]; diff --git a/server/src/server.ts b/server/src/server.ts index 24f0d3ee1..16515b415 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -31,7 +31,7 @@ import { projectsFiles } from "./projectFiles"; // Absolute paths to all the workspace folders // Configured during the initialize request -const workspaceFolders = new Set(); +export const workspaceFolders = new Set(); // This holds client capabilities specific to our extension, and not necessarily // related to the LS protocol. It's for enabling/disabling features that might From a7601db7b534405b444686ba1f396c46a48b3646 Mon Sep 17 00:00:00 2001 From: nojaf Date: Thu, 2 Oct 2025 09:20:57 +0200 Subject: [PATCH 3/3] Changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27f41a6ed..44465bae3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ - Use `prepareRename` command (when a new enough ReScript version is used) to speed up the `rename` command. https://github.com/rescript-lang/rescript-vscode/pull/1124 - Use `compiler-info.json` to find the `@rescript/runtime` and `bsc.exe` if available. https://github.com/rescript-lang/rescript-vscode/pull/1129 - Add `Dump LSP Server State` command to client. https://github.com/rescript-lang/rescript-vscode/pull/1130 +- Use `compiler-info.json` to locate other binaries as well. https://github.com/rescript-lang/rescript-vscode/pull/1135 +- Detect Rewatch from workspace root. https://github.com/rescript-lang/rescript-vscode/pull/1135 ## 1.64.0