Skip to content

Commit fad3de2

Browse files
fhammerschmidtcristianoc
authored andcommitted
Add changes according review
1 parent a89b1e1 commit fad3de2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

server/src/server.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ let codeActionsFromDiagnostics: codeActions.filesCodeActions = {};
7979
// will be properly defined later depending on the mode (stdio/node-rpc)
8080
let send: (msg: p.Message) => void = (_) => {};
8181

82+
// Check if the rescript binary is available at node_modules/.bin/rescript,
83+
// otherwise recursively check parent directories for it.
8284
let findBinaryPathFromProjectRoot = (
8385
directory: p.DocumentUri // This must be a directory and not a file!
8486
): null | p.DocumentUri => {
@@ -321,7 +323,10 @@ let openedFile = (fileUri: string, fileContent: string) => {
321323
type: p.MessageType.Error,
322324
message:
323325
extensionConfiguration.binaryPath == null
324-
? "Can't find ReScript binary"
326+
? `Can't find ReScript binary in ${path.join(
327+
projectRootPath,
328+
c.nodeModulesBinDir
329+
)} or parent directories. Did you install it? It's required to use "rescript" > 9.1`
325330
: `Can't find ReScript binary in the directory ${extensionConfiguration.binaryPath}`,
326331
},
327332
};

0 commit comments

Comments
 (0)