File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -38,13 +38,14 @@ export let bsbBinName = "bsb";
3838
3939export let bscBinName = "bsc" ;
4040
41+ export let nodeModulesBinDir = path . join ( "node_modules" , ".bin" ) ;
42+
4143// can't use the native bsb/rescript since we might need the watcher -w flag, which is only in the JS wrapper
4244export let rescriptNodePartialPath = path . join (
43- "node_modules" ,
44- ".bin" ,
45- rescriptBinName ,
45+ nodeModulesBinDir ,
46+ rescriptBinName
4647) ;
47- export let bsbNodePartialPath = path . join ( "node_modules" , ".bin" , bsbBinName ) ;
48+ export let bsbNodePartialPath = path . join ( nodeModulesBinDir , bsbBinName ) ;
4849
4950export let bsbLock = ".bsb.lock" ;
5051export let bsconfigPartialPath = "bsconfig.json" ;
Original file line number Diff line number Diff line change @@ -75,6 +75,11 @@ let findBscBinary = (filePath: p.DocumentUri) =>
7575 ? utils . findBscBinaryFromProjectRoot ( filePath )
7676 : utils . findBscBinaryFromConfig ( extensionConfiguration . binaryPath ) ;
7777
78+ let getConjecturalDirOfBuildBinary = ( projectRootPath : p . DocumentUri ) =>
79+ extensionConfiguration . binaryPath === null
80+ ? path . join ( projectRootPath , c . nodeModulesBinDir )
81+ : extensionConfiguration . binaryPath ;
82+
7883interface CreateInterfaceRequestParams {
7984 uri : string ;
8085}
@@ -267,17 +272,14 @@ let openedFile = (fileUri: string, fileContent: string) => {
267272 // handle in the isResponseMessage check in the message handling way
268273 // below
269274 } else {
270- let binaryPath =
271- extensionConfiguration . binaryPath === null
272- ? path . join ( projectRootPath , "node_modules" , ".bin" )
273- : extensionConfiguration . binaryPath ;
274-
275275 let request : p . NotificationMessage = {
276276 jsonrpc : c . jsonrpcVersion ,
277277 method : "window/showMessage" ,
278278 params : {
279279 type : p . MessageType . Error ,
280- message : `Can't find ReScript binary on path ${ binaryPath } ` ,
280+ message : `Can't find ReScript binary in the directory ${ getConjecturalDirOfBuildBinary (
281+ projectRootPath
282+ ) } `,
281283 } ,
282284 } ;
283285 send ( request ) ;
You can’t perform that action at this time.
0 commit comments