Skip to content

vscode: add support for debug/toolbar, debug/variables/context menus contribution and debugState when clause context  #11871

Closed
@kittaakos

Description

@kittaakos

Feature Description:

Add support for the following in Theia to improve the VS Code compatibility:


Steps to reproduce:

  • Check out the vscode-mock-debug--theia branch in my fork,
  • Build and start Theia from the sources (make sure to run yarn download:plugins to make the mock debugger VS Code extension available before Theia start),
  • Open the sampleWorkspace folder from Microsoft/vscode-mock-debug repo as a workspace in Theia,
  • Open the Debug view and start Debug readme.md,

Screen Shot 2022-11-16 at 17 05 57

2022-11-16T15:08:02.683Z root WARN Failed to register a menu item for plugin kittaakos.mock-debug contributed to debug/toolBar {
  command: 'extension.mock-debug.sayHello',
  submenu: undefined,
  alt: undefined,
  group: 'navigation',
  when: "debugType == 'mock'"
} Error: Could not find submenu with id debug/toolBar
    at MenuModelRegistry.getMenuNode (file:///Users/a.kitta/dev/git/theia/examples/electron/lib/bundle.js:137499:23)
    at file:///Users/a.kitta/dev/git/theia/examples/electron/lib/packages_plugin-ext_lib_hosted_browser_hosted-plugin_js.js:6634:66
    at Array.forEach (<anonymous>)
    at MenusContributionPointHandler.handle (file:///Users/a.kitta/dev/git/theia/examples/electron/lib/packages_plugin-ext_lib_hosted_browser_hosted-plugin_js.js:6628:37)
    at file:///Users/a.kitta/dev/git/theia/examples/electron/lib/packages_plugin-ext_lib_hosted_browser_hosted-plugin_js.js:7350:71
    at pushContribution (file:///Users/a.kitta/dev/git/theia/examples/electron/lib/packages_plugin-ext_lib_hosted_browser_hosted-plugin_js.js:7245:32)
    at PluginContributionHandler.handleContributions (file:///Users/a.kitta/dev/git/theia/examples/electron/lib/packages_plugin-ext_lib_hosted_browser_hosted-plugin_js.js:7350:9)
    at HostedPluginSupport.loadContributions (file:///Users/a.kitta/dev/git/theia/examples/electron/lib/packages_plugin-ext_lib_hosted_browser_hosted-plugin_js.js:446:61)
    at HostedPluginSupport.doLoad (file:///Users/a.kitta/dev/git/theia/examples/electron/lib/packages_plugin-ext_lib_hosted_browser_hosted-plugin_js.js:358:42)
    at async ProgressService.withProgress (file:///Users/a.kitta/dev/git/theia/examples/electron/lib/bundle.js:140547:20)
2022-11-16T15:08:02.681Z root WARN Failed to register a menu item for plugin kittaakos.mock-debug contributed to debug/variables/context {
  command: 'extension.mock-debug.sayVariableContextMenu',
  submenu: undefined,
  alt: undefined,
  group: 'navigation',
  when: "inDebugMode && debugType == 'mock' && debugState == stopped"
} Error: Could not find submenu with id debug/variables/context
    at MenuModelRegistry.getMenuNode (file:///Users/a.kitta/dev/git/theia/examples/electron/lib/bundle.js:137499:23)
    at file:///Users/a.kitta/dev/git/theia/examples/electron/lib/packages_plugin-ext_lib_hosted_browser_hosted-plugin_js.js:6634:66
    at Array.forEach (<anonymous>)
    at MenusContributionPointHandler.handle (file:///Users/a.kitta/dev/git/theia/examples/electron/lib/packages_plugin-ext_lib_hosted_browser_hosted-plugin_js.js:6628:37)
    at file:///Users/a.kitta/dev/git/theia/examples/electron/lib/packages_plugin-ext_lib_hosted_browser_hosted-plugin_js.js:7350:71
    at pushContribution (file:///Users/a.kitta/dev/git/theia/examples/electron/lib/packages_plugin-ext_lib_hosted_browser_hosted-plugin_js.js:7245:32)
    at PluginContributionHandler.handleContributions (file:///Users/a.kitta/dev/git/theia/examples/electron/lib/packages_plugin-ext_lib_hosted_browser_hosted-plugin_js.js:7350:9)
    at HostedPluginSupport.loadContributions (file:///Users/a.kitta/dev/git/theia/examples/electron/lib/packages_plugin-ext_lib_hosted_browser_hosted-plugin_js.js:446:61)
    at HostedPluginSupport.doLoad (file:///Users/a.kitta/dev/git/theia/examples/electron/lib/packages_plugin-ext_lib_hosted_browser_hosted-plugin_js.js:358:42)
    at async ProgressService.withProgress (file:///Users/a.kitta/dev/git/theia/examples/electron/lib/bundle.js:140547:20)

Missing features:

  1. The custom command is missing from the debug toolbar (debug/toolbar).
    Screen Shot 2022-11-16 at 17 51 09

    Screen Shot 2022-11-16 at 17 04 53
  2. The context menu is unavailable for the Variables view (debug/variables/context).
    Screen Shot 2022-11-16 at 15 05 53
    Screen Shot 2022-11-16 at 17 06 22

  3. The debugState when context is undefined. It should be one of the following: 'inactive', 'initializing', 'stopped', 'running'. To verify this, I have written a sample command to show the when context value for a key.

    • inDebugMode is supported, ✅
    • debugType is supported, ✅
    • debugState is undefined. ❌
      Screen Shot 2022-11-16 at 17 00 14
      Screen Shot 2022-11-16 at 17 00 25
      Screen Shot 2022-11-16 at 17 00 46

Metadata

Metadata

Assignees

Labels

debugissues that related to debug functionalityvscodeissues related to VSCode compatibility

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions