【发布时间】:2021-03-28 12:23:16
【问题描述】:
这里是 Vscode 菜鸟,试图在编辑器上下文菜单中获取保存项。我已经做到了:
{
"name": "vsContextSave",
"displayName": "vsContextSave",
"description": "add save item to editor context menu",
"version": "0.0.0",
"publisher": "njamescouk",
"repository": {
"type": "git",
"url": ""
},
"license": "MIT License",
"engines": {
"vscode": "^1.40.0"
},
"contributes": {
"menus": {
"editor/context": [
{
"command": "workbench.action.files.save",
"group": "9_cutcopypaste",
"when": "editorTextFocus"
}
]
}
},
"__metadata": {}
}
当包装在 .vscode\extensions 目录中的目录中时,vscode 会看到它,并且 vsContextSave 会显示在扩展列表中并被启用。但是我在上下文菜单中没有看到保存项。
编辑:
我在元数据语句之前插入了一个激活事件,但显然我需要一个带有 activate() 函数的主模块。
"activation Events": ["onStartupFinished"],
【问题讨论】:
-
你定义了一个空的激活函数
-
没有。我应该在哪里以及如何做?
标签: visual-studio-code vscode-settings vscode-extensions