是否可以在编辑器的右侧添加新的菜单栏 - VSCode Extension?

问题描述 投票:1回答:1

在编辑器的右上方,有没有办法添加新的菜单栏项并在其上附加命令?

afaik我只能使用"menus" / "editor/title"为现有菜单项添加条目。

enter image description here

visual-studio-code vscode-extensions
1个回答
1
投票

你已经联系过的"editor/title"应该是正确的位置。以下是内置Markdown扩展的示例,其中uses it to add the "Open Preview To The Side" button位于.md文件中:

"contributes": {
    "menus": {
        "editor/title": [
            {
                "command": "markdown.showPreviewToSide",
                "when": "editorLangId == markdown",
                "alt": "markdown.showPreview",
                "group": "navigation"
            }
        ]
    }
}

© www.soinside.com 2019 - 2024. All rights reserved.