Abdul Saqib
Abdul Saqib

Reputation: 337

Run specific file always vscode-code-runner

Is there any setting for vscode-code-runner to setup a file that would be always run when I click on run button regardless which file is open in editor currently.

Upvotes: 3

Views: 936

Answers (1)

Nathan G-T
Nathan G-T

Reputation: 91

as of writing this comment i do not believe it's possible with this extension. The next best thing i can recommend is to execute the file you want to run with coderunner, then copy the command that it generated and executed. You can then paste this command in your setting.json file as a custom command like so

{
    "code-runner.customCommand": "<created command>",
}

To execute the custom command from anywhere in your workspace, do ctrl+alt+K

You can also create a launch.settings file to run and debug your code from the debug tab which you can then execute with ctrl+shift+D

it's not as slick as a nice run button but it's better than nothing

Upvotes: 1

Related Questions