run: raco pkg show --full-checksum racket-langserver
Magic Racket version 0.5.6
Error message
Launching server using command /c/Program\ Files/Racket/Racket.exe failed.
Reason
Basically, if you're using Git Bash as your primary terminal in VSCode, there's this error where you can either format the executable path to work for the Racket Language Client, or to work for the REPL integration, but not both. This is because Git Bash tries to make the syntax of the terminal as close to the UNIX version as possible. But because of this if you want it to work for the language server, you need to put the windows path like:
I think a good way to make this work is to just include a new Setting into the extension that basically allows you to specify a different Racket path for running on the REPL as opposed to communicating with the language server.
So for just a first pass, the usage might look like this:
This could be a pretty simple change in the codebase if you just include an option into the withRacket hook that you implemented.
export function withRacket(func: Function, repl: boolean = false) {
const racketConfig = vscode.workspace.getConfiguration("magic-racket.general");
const racket = (repl && racketConfig.get("REPLRacketPath")) || racketConfig.get("racketPath");
if (racket !== "") {
func(racket);
} else {
vscode.window.showErrorMessage(
"No Racket executable specified. Please add the path to the Racket executable in settings",
);
}
}
Then, when you call it, when it opens in the REPL, just set that option to true (or false if it's more common to use REPL than to communicate with the language server.
withRacket(func, true);
Not the perfect solution, but it would at least give the option of using different paths.
Environment
racket -v
raco pkg show --full-checksum racket-langserver
Error message
Reason
Basically, if you're using Git Bash as your primary terminal in VSCode, there's this error where you can either format the executable path to work for the Racket Language Client, or to work for the REPL integration, but not both. This is because Git Bash tries to make the syntax of the terminal as close to the UNIX version as possible. But because of this if you want it to work for the language server, you need to put the windows path like:
But to work for loading it into the REPL, you have to format it like this:
Suggested Solution
I think a good way to make this work is to just include a new Setting into the extension that basically allows you to specify a different Racket path for running on the REPL as opposed to communicating with the language server.
So for just a first pass, the usage might look like this:
This could be a pretty simple change in the codebase if you just include an option into the
withRacket
hook that you implemented.Then, when you call it, when it opens in the REPL, just set that option to true (or false if it's more common to use REPL than to communicate with the language server.
Not the perfect solution, but it would at least give the option of using different paths.
Let me know what you think! ~ Leo