我已经写了扩展
Command Variable
v1.57.0版本。
与扩展一起
Launch Configs
通过ArturoDent,您可以定义
F5
替换基于当前编辑器文件启动配置的键绑定:
{
"key": "f5",
"command": "extension.commandvariable.transform",
"when": "debuggersAvailable && debugState == 'inactive'",
"args": {
"text": "${command:launchCommand}",
"command": {
"launchCommand": {
"command": "${transform:launchCommand}",
"transform": {
"launchCommand": {
"text": "${command:launchCommand}",
"command": {
"launchCommand": {
"command": "extension.commandvariable.file.fileAsKey",
"args": {
"app.py": "launches.Streamlit",
"@default": "launches.OtherPython"
}
}
}
}
}
}
}
}
}
你需要编辑
settings.json
对于启动配置:
"launches": {
"Streamlit": "Python: app.py",
"OtherPython": "Python: Current File"
}
也许您需要添加工作区/文件夹名称,请参阅启动配置文档。