我想知道在建立.vscode / launch.json的项目时是否有办法命令ssh命令?像“ssh -i xxxxx”
这样的东西或者是否可以创建一个可以从F1弹出窗口运行的命令,RunCustomCommandxx
答案 0 :(得分:1)
我的配置版本允许只运行定义的任务并继续执行(在我的情况下,任务是运行当前打开的Groovy文件):
options(repr.plot.width = 14, repr.plot.height = 8)
任务:
"configurations": [
{
"name": "Launch groovy",
"request": "launch",
"type": "coreclr",
"preLaunchTask": "groovy",
"program": "cmd.exe",
"args": ["/c"],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"internalConsoleOptions": "neverOpen"
}
]
答案 1 :(得分:0)
对我来说,我只需要一个不同的环境变量。您不需要执行此任务,因为(至少对我来说)启动器运行时该任务不起作用。
由于here,我可以在启动器(launch.json)条目中像这样工作:
"environment": [{
"name": "ENVIRONMENT_VARIABLE_NAME",
"value": "${workspaceFolder}/lib" //Set to whatever value you want.
}],
答案 2 :(得分:0)
格式已更改。 VSCode可以为您创建tasks.json
文件。在您的launch.json
文件和任何配置对象中,只需定义preLaunchTask
即可强制自动创建tasks.json
模板文件:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "launch program",
"skipFiles": [ "<node_internals>/**"],
"preLaunchTask": "myShellCommand",
"program": "${workspaceFolder}/test.js"
}
]
}
如果未配置tasks.json
:
could not find the task
myShellCommand
Configure Task
> Create tasks.json file
from template
> others
然后将为您创建tasks.json
模板文件。将命令添加到command
,并将您在preLaunchTask
中输入的名称添加到label
:
{
"version": "2.0.0",
"tasks": [
{
"label": "myShellCommand",
"type": "shell",
"command": "echo goodfood"
}
]
}