File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed
Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 11import * as path from "path" ;
22
3- let platformDir =
3+ export let platformDir =
44 process . arch == "arm64" ? process . platform + process . arch : process . platform ;
55
66// See https://microsoft.github.io/language-server-protocol/specification Abstract Message
Original file line number Diff line number Diff line change @@ -108,12 +108,28 @@ let findRescriptBinary = (projectRootPath: p.DocumentUri) =>
108108let findBscBinary = ( projectRootPath : p . DocumentUri ) => {
109109 let rescriptBinaryPath = findRescriptBinary ( projectRootPath ) ;
110110 if ( rescriptBinaryPath !== null ) {
111- return path . join (
111+ let rescriptDirPath = path . join (
112112 path . dirname ( rescriptBinaryPath ) ,
113113 ".." ,
114- c . platformPath ,
115- c . bscExeName
114+ "rescript"
116115 ) ;
116+
117+ let bscBinaryPath = path . join ( rescriptDirPath , c . platformDir , c . bscExeName ) ;
118+
119+ // Workaround for darwinarm64 which has no folder yet in ReScript <= 9.1.4
120+ if (
121+ process . platform == "darwin" &&
122+ process . arch == "arm64" &&
123+ ! fs . existsSync ( bscBinaryPath )
124+ ) {
125+ bscBinaryPath = path . join (
126+ rescriptDirPath ,
127+ process . platform ,
128+ c . bscExeName
129+ ) ;
130+ }
131+
132+ return bscBinaryPath ;
117133 }
118134 return null ;
119135} ;
You can’t perform that action at this time.
0 commit comments