Last active
March 18, 2024 02:16
-
-
Save puffybsd/aff5193465b5cba4a07d7f700a357ffc to your computer and use it in GitHub Desktop.
executorMap for vscode code runner rust files. Checks if the directory is examples and executes current file, or performs a standard cargo run.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"code-runner.executorMap": { | |
"rust": "if [ $(basename $dir) = 'examples' ]; then cargo run --example $fileNameWithoutExt; else cargo run; fi", | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Psy-Kosh,
When I ran
cargo build
it was fine. When I ran it inside VSCode it failed.All I needed to do was alter /VScode/Preferences/Settings.json:
hope that helps.