Description
Extension version: 1.7.6 (latest master)
The Format document
feature uses the bsc.exe
binary:
rescript-vscode/server/src/server.ts
Lines 740 to 742 in 877f874
The location of the bsc.exe
binary is determined as follows:
rescript-vscode/server/src/server.ts
Lines 112 to 121 in 877f874
It is "reverse engineered" from the location of the rescript
binary:
rescript-vscode/server/src/server.ts
Lines 107 to 110 in 877f874
rescript-vscode/server/src/utils.ts
Lines 56 to 60 in 877f874
The node_modules/.bin/rescript
symlink exists both at the monorepo top level node_modules
and the subdir node_modules
, which makes findRescriptBinary
return src/monorepo/subdir/node_modules/.bin/rescript
.
However, the node_modules/rescript
directory usually exists only at the monorepo top level, so when the path of the rescript
binary is used to derive the location of bsc.exe
, this results in the non-existent path src/monorepo/subdir/node_modules/rescript/linux/bsc.exe
. It should actually return src/monorepo/node_modules/rescript/linux/bsc.exe
(without subdir
).
To make things more complicated, if node_modules/rescript
does exist in the subdir, that directory should be used. This may be the case when multiple rescript
versions are used in the same monorepo.