microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.81k stars 29.12k forks source link

Support `webviewId` in `when` under `editor/title` #216478

Open worksofliam opened 4 months ago

worksofliam commented 4 months ago

I would like to add buttons/commands to the webview panel, much like we can do with editor titles.

Here's an example:

      "editor/title": [
        {
          "when": "editorLangId == sql && code-for-ibmi:connected == true && vscode-db2i:statementCanCancel != true",
          "group": "navigation@1",
          "submenu": "sql/editor/context"
        },
        {
          "command": "vscode-db2i.statement.cancel",
          "when": "(editorLangId == sql || webviewId == sqlResultSet) && vscode-db2i:statementCanCancel == true",
          "group": "navigation@1"
        }
      ],

Working with editor:

image

Not working in webview:

image

Or, perhaps, there is another context I should use for webview buttons? I don't believe it to be webview/context.

vs-code-engineering[bot] commented 1 month ago

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!