formulahendry / vscode-code-runner

Code Runner for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner
MIT License
2.19k stars 293 forks source link

multiple executor map entries #48

Open callamaris opened 7 years ago

callamaris commented 7 years ago

Hi,

please add an option to configure multiple commands for filetypes:

this would be usefull if you need to execute your code in different environments.

Examples:

If you have multiple tools configured, the code runner will ask you wich tool you want to use.

You should be able to configure the order, in which the tools will be listed. (priority config, alphabetical or recently used)

Configuration example: { "code-runner.executorMap": { "bash": { "local" : "bash", "remote" : "ssh" }, "sql": { "mysql" : "mysql", "oracle" : "sqlplus", "postgreSQL" : "psql" }, } }

formulahendry commented 7 years ago

What is the E2E experience for user to use it? Showing a input dialog, if it is bash, then let user choose to run 'local' or 'remote'?

callamaris commented 7 years ago

Showing a input dialog, if it is bash, then let user choose to run 'local' or 'remote'?

Yes.

the input dialog should list all configured options for the type of the current file (local, remote)

The option with the highest priority should be pre-selected. this way the user only needs to hit enter when the dialog pops up in the most common case.

pre-selecting by recently used is probably the best way to avoid unnecessaray clicks or keystrokes

recently used means, logging the last 10-20 uses and pre-selecting the option with the highest count of uses.

formulahendry commented 7 years ago

I will investigate whether it is possible to implement this.

sbromberger commented 6 years ago

This would be very useful when building multiple environments: for example, xcode/clang on OSX does not support OMP, but g++ installed via homebrew does. It'd be great to be able to select different build commands depending on what you're building.

Abderrelmsd commented 2 years ago

Hi. I think this would be very useful in the case of Windows + WSL. I am using Visual Studio's tools (cl, cs, python) while on WSL, there are different tools (gcc, g++, python3).