-
Notifications
You must be signed in to change notification settings - Fork 60
Call bsc.exe directly, when no binaryPath is set in settings #529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call bsc.exe directly, when no binaryPath is set in settings #529
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comments on how to make this simpler and more future-proof.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great thanks.
Just need confirmation from Windows users that this works.
@@ -6,11 +6,12 @@ let platformDir = | |||
// See https://microsoft.github.io/language-server-protocol/specification Abstract Message | |||
// version is fixed to 2.0 | |||
export let jsonrpcVersion = "2.0"; | |||
export let platformPath = path.join("rescript", platformDir); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: check that platformDir
computation is in sync with the compiler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite, in rescript-vscode the platformDir
also allows for "linuxarm64", the compiler does not:
https://github.com/rescript-lang/rescript-compiler/blob/master/bsc#L6-L12
https://github.com/rescript-lang/rescript-compiler/blob/master/scripts/bin_path.js#L8-L11
Edit: Or technically also "win32arm64"? Shall I adapt it to be the same as the compiler?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case the compiler is a little behind and could be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or is the logic in rescript-vscode correct? The compiler has no directories for win32arm64
or linuxarm64
, and neither do they get built in CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be kind of future-proof, if one wants to build from source.
But does not matter much either way, as this is rarely done I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
I think the README already aligns with this process to find the executable, and requires no change. |
Merge away any time. |
This should fix #514 and also will make formatting faster (at least on windows).
Supersedes #521
I refactored the binary lookup a bit so that:
When no binaryPath is set, the extension will lookup and use the
bsc.exe
now (again).Also the message when no binary has been found could have shown null as path. I simplified it for that case.
Edit: Fixes #530 now as well.