我了解vscode扩展API的基本知识。我已经创建了自己的扩展触棒,以供个人使用一些git命令。所以说到重点,我想展示的是我的触摸屏扩展上的时钟(hh:mm)。就我阅读文档而言,如果我想在触摸屏上显示文本,我可以这样做.
"contributes": {
"commands": [
{
"command": "git-touchbar.showTime",
"title": "12:00"
}}}但它是静态的。我想要做的是更新标题栏上的标题属性,在间隔1分钟之后。它不需要在每秒钟之后更新。已经有一些扩展,显示状态栏上的时钟。但我想把它展示在我的触屏延伸上。
提前感谢
发布于 2022-01-08 16:28:38
您可以向菜单中添加24 (00-23)个小时命令和60 (00-59)分钟命令,并使用上下文变量touchbar-hour和touchbar-minute来控制哪个命令是可见的。
"contributes": {
"commands": [
{
"command": "git-touchbar.hour00",
"title": "00:"
},
{
"command": "git-touchbar.hour01",
"title": "01:"
},
.....
]
"menus": {
"touchBar": [
{
"command": "git-touchbar.hour00",
"group": "gittools",
"when": "touchbar-hour == 0"
},
{
"command": "git-touchbar.hour01",
"group": "gittools",
"when": "touchbar-hour == 1"
},
.....
]
}在扩展中,您设置了2个上下文变量的值。
您应该编写一个小节点或Python脚本来生成package.json的168个条目。
https://stackoverflow.com/questions/70634112
复制相似问题