diff --git a/CHANGELOG.md b/CHANGELOG.md index 54407d177..11efe49d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,12 @@ > - :house: [Internal] > - :nail_care: [Polish] +## [Unreleased] + +#### :nail_care: Polish + +- Resolve symlinks when finding platform binaries. https://github.com/rescript-lang/rescript-vscode/pull/1154 + ## 1.70.0 #### :bug: Bug fix diff --git a/server/src/utils.ts b/server/src/utils.ts index 9446585cd..09134571f 100644 --- a/server/src/utils.ts +++ b/server/src/utils.ts @@ -145,8 +145,10 @@ let findBinary = async ( // TODO: export `binPaths` from `rescript` package so that we don't need to // copy the logic for figuring out `target`. const target = `${process.platform}-${process.arch}`; + // Use realpathSync to resolve symlinks, which is necessary for package + // managers like Deno and pnpm that use symlinked node_modules structures. const targetPackagePath = path.join( - rescriptDir, + fs.realpathSync(rescriptDir), "..", `@rescript/${target}/bin.js`, );