formulahendry / formulahendry/vscode-code-runner

Problem running 'cargo run' on code-runner

Open
#500 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.4k
Forks
351
PR merge metrics
No merged PRs in 30d

Description

I have been trying several ways in configuring code-runner to run Rust file, none of which works for me:
**System-info**

OS: macOS Mojave 10.14.5

**Attempt**
Follow the recipe of #410 I have tried to add these in my `settings.json` file:
```json
"code-runner.executorMap": {
"rust": "cargo run # $fileName",

// or this

"rust": "cargo run $workspaceRoot",

// or this

"rust": "cargo run $fileName",
},

// or I have also configured like this:

"code-runner.customCommand": "cargo run",
```
All produce the same error:
`
[Running] cargo run
/bin/sh: cargo: command not found

[Done] exited with code=127 in 0.024 seconds
`
Meanwhile running on terminal works fine.

Here are some possible relevant configs:
``` json
"code-runner.showExecutionMessage": true,
"code-runner.clearPreviousOutput": true,
"code-runner.fileDirectoryAsCwd": true,
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.