在VS代码中添加调试配置的当前时间



是否可以在Visual Studio代码中添加当前时间来调试配置?例如:

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Run Module with Time",
"type": "python",
"request": "launch",
"module": "my_module",
"args": [
"-time",
"CURRENT TIME",
]
}
]
}

您可以使用扩展命令变量并使用命令extension.commandvariable.dateTime(参见链接中的示例3(。由于传递了参数,您必须使用${input:XXXX}变量。

检查这个代码示例,它在我的中起作用

"date: $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE
$CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND",

最新更新