Closed shengjiex98 closed 2 years ago
Duplicate of #63
Duplicate of #63
Thanks for pointing it out. As I understand it the marketplace version is not fixed yet, correct?
Thanks for pointing it out. As I understand it the marketplace version is not fixed yet, correct?
https://marketplace.visualstudio.com/items/evzen-wybitul.magic-racket/changelog
Version 0.6.2 fixes this, try updating to the latest version or reinstalling the extension.
Version 0.6.2 fixes this
Edit: the bug still exists in 0.6.2 (download from marketplace)
I checked the code of version 0.6.2 which download by:
marketplace version repl.js:
exports.executeSelectionInRepl = executeSelectionInRepl;
function runFileInTerminal(command, filePath, terminal) {
terminal.show();
terminal.sendText(`clear`);
terminal.sendText((0, shell_quote_1.quote)([...command, filePath]));
// Leaving this here if we ever need to fix cmd.exe again
// const shell: string | undefined = vscode.workspace
// .getConfiguration("terminal.integrated.shell")
// .get("windows");
// if (process.platform === "win32" && shell && /cmd\.exe$/.test(shell)) {
// // cmd.exe doesn't recognize single quotes
// terminal.sendText(`${racket} "${filePath}"`);
// } else {
// terminal.sendText(`${racket} '${filePath}'`);
// }
}
fixed version repl.ts:
export function runFileInTerminal(
command: string[],
filePath: string,
terminal: vscode.Terminal,
): void {
terminal.show();
if (isWindowsOS()) {
terminal.sendText(isPowershellShell() || isCmdExeShell() ? `cls` : `clear`);
const racketExePath = quoteWindowsPath(command[0], true);
filePath = quoteWindowsPath(filePath, false);
terminal.sendText(`${racketExePath} ${command.slice(1).join(' ')} ${filePath}`);
} else {
terminal.sendText(`clear`);
terminal.sendText(quote([...command, filePath]));
}
}
Looks like the wrong file was packaged and published.
That makes sense. Should I close the issue, or keep it open until it is fixed in the released version?
Maybe should keep it open and wait for the author to merge pr (#68) to release a new version ?
Should be fixed in 0.6.3. Made sure to package the correct code this time. Please, test this and then close the issue if everything is ok.
v 0.6.3 still not work under Windows
the wrong path that magic-racket
generates:
c:/Users/play.rkt
the correct path:
C://Users/play.rkt
NOTE: c:/
and C://
I'm sorry, I was wrong in the last comment. I new to Racket.
the problem is not from generated path.
It's so strange that Racket: Load file in REPL
button doesn't work for the first time, but it works after that.
see what I mean:
as you can see, the first time that the extension passed the code with --eval
flag, it raises an error, but the second time that I clicked on that button, it works fine.
is that a Racket issue ?
@hamidb80 It's magic-racket's issue (#65, #66) which has been fixed but not published properly: https://github.com/Eugleo/magic-racket/issues/66#issuecomment-1022130597
Should be fixed. I manually downloaded the 0.6.4 from the marketplace and checked that the repl.js
file is the correct one. Sorry everyone for the mishaps!
Environment
Error message
Additional context
This occurs when trying to click the green arrow
Racket: run file in terminal
. Running the command mannual without the\
inserted in the path (i.e. runningracket c\:/Users/Shengjie/Desktop/test.rkt
manually can run the file just fine.If relevant, please enclose a minimal example file which triggers the errors. If you're unable to enclose the file, please do the following instead:
No log is generated. Here's the test file: