Skip to content

Commit 98e3e94

Browse files
committed
Fix issue in finding bsc binary.
Fixes #496
1 parent 0d2249c commit 98e3e94

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/src/server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,8 @@ function format(msg: p.RequestMessage): Array<p.Message> {
617617
} else {
618618
// code will always be defined here, even though technically it can be undefined
619619
let code = getOpenedFileContent(params.textDocument.uri);
620-
let bscBinaryPath = findBscBinary(filePath);
620+
let projectRootPath = utils.findProjectRootOfFile(filePath);
621+
let bscBinaryPath = projectRootPath === null ? null : findBscBinary(projectRootPath);
621622
let formattedResult = utils.formatCode(bscBinaryPath, filePath, code);
622623
if (formattedResult.kind === "success") {
623624
let max = code.length;

0 commit comments

Comments
 (0)