Skip to content

Commit

Permalink
vscode: support editor/title/run predefined entry
Browse files Browse the repository at this point in the history
Closes: eclipse-theia#9387

The commit adds  the "editor/title/run" contribution point to menus

Contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>
  • Loading branch information
rschnekenbu committed Jun 21, 2023
1 parent 8831c9d commit a405cb9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
## v1.39.0 - 06/29/2023

- [debug] added support for conditional exception breakpoints [#12445](https://github.com/eclipse-theia/theia/pull/12445)
- [vscode] Support "editor/title/run" toolbar commands [#12637](https://github.com/eclipse-theia/theia/pull/12637) - Contributed on behalf of STMicroelectronics

<a name="breaking_changes_1.39.0">[Breaking Changes:](#breaking_changes_1.39.0)</a>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { PluginViewWidget } from '../view/plugin-view-widget';
import { QuickCommandService } from '@theia/core/lib/browser';
import {
CodeEditorWidgetUtil, codeToTheiaMappings, ContributionPoint,
PLUGIN_EDITOR_TITLE_MENU, PLUGIN_SCM_TITLE_MENU, PLUGIN_VIEW_TITLE_MENU
PLUGIN_EDITOR_TITLE_MENU, PLUGIN_EDITOR_TITLE_RUN_MENU, PLUGIN_SCM_TITLE_MENU, PLUGIN_VIEW_TITLE_MENU
} from './vscode-theia-menu-mappings';
import { PluginMenuCommandAdapter, ReferenceCountingSet } from './plugin-menu-command-adapter';
import { ContextKeyExpr } from '@theia/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey';
Expand Down Expand Up @@ -56,6 +56,7 @@ export class MenusContributionPointHandler {
this.initialized = true;
this.commandAdapterRegistry.registerAdapter(this.commandAdapter);
this.tabBarToolbar.registerMenuDelegate(PLUGIN_EDITOR_TITLE_MENU, widget => this.codeEditorWidgetUtil.is(widget));
this.tabBarToolbar.registerMenuDelegate(PLUGIN_EDITOR_TITLE_RUN_MENU, widget => this.codeEditorWidgetUtil.is(widget));
this.tabBarToolbar.registerMenuDelegate(PLUGIN_SCM_TITLE_MENU, widget => widget instanceof ScmWidget);
this.tabBarToolbar.registerMenuDelegate(PLUGIN_VIEW_TITLE_MENU, widget => widget instanceof PluginViewWidget);
this.tabBarToolbar.registerItem({ id: 'plugin-menu-contribution-title-contribution', command: '_never_', onDidChange: this.onDidChangeTitleContributionEmitter.event });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export class PluginMenuCommandAdapter implements MenuCommandAdapter {
['editor/context', selectedResource],
['editor/title', widgetURI],
['editor/title/context', selectedResource],
['editor/title/run', widgetURI],
['explorer/context', selectedResource],
['scm/resourceFolder/context', toScmArgs],
['scm/resourceGroup/context', toScmArgs],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { VIEW_ITEM_CONTEXT_MENU } from '../view/tree-view-widget';
import { WebviewWidget } from '../webview/webview';

export const PLUGIN_EDITOR_TITLE_MENU = ['plugin_editor/title'];
export const PLUGIN_EDITOR_TITLE_RUN_MENU = ['plugin_editor/title/run'];
export const PLUGIN_SCM_TITLE_MENU = ['plugin_scm/title'];
export const PLUGIN_VIEW_TITLE_MENU = ['plugin_view/title'];

Expand All @@ -45,6 +46,7 @@ export const implementedVSCodeContributionPoints = [
'editor/context',
'editor/title',
'editor/title/context',
'editor/title/run',
'explorer/context',
'scm/resourceFolder/context',
'scm/resourceGroup/context',
Expand All @@ -68,6 +70,7 @@ export const codeToTheiaMappings = new Map<ContributionPoint, MenuPath[]>([
['editor/context', [EDITOR_CONTEXT_MENU]],
['editor/title', [PLUGIN_EDITOR_TITLE_MENU]],
['editor/title/context', [SHELL_TABBAR_CONTEXT_MENU]],
['editor/title/run', [PLUGIN_EDITOR_TITLE_RUN_MENU]],
['explorer/context', [NAVIGATOR_CONTEXT_MENU]],
['scm/resourceFolder/context', [ScmTreeWidget.RESOURCE_FOLDER_CONTEXT_MENU]],
['scm/resourceGroup/context', [ScmTreeWidget.RESOURCE_GROUP_CONTEXT_MENU]],
Expand Down

0 comments on commit a405cb9

Please sign in to comment.