Skip to content

Commit 8043260

Browse files
authored
vscode: support editor/title/run predefined entry (#12637)
Closes: #9387 The commit adds the "editor/title/run" contribution point to menus Contributed on behalf of STMicroelectronics Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>
1 parent 2c80a56 commit 8043260

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
## v1.39.0 - 06/29/2023
88

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

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

packages/plugin-ext/src/main/browser/menus/menus-contribution-handler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { PluginViewWidget } from '../view/plugin-view-widget';
2626
import { QuickCommandService } from '@theia/core/lib/browser';
2727
import {
2828
CodeEditorWidgetUtil, codeToTheiaMappings, ContributionPoint,
29-
PLUGIN_EDITOR_TITLE_MENU, PLUGIN_SCM_TITLE_MENU, PLUGIN_VIEW_TITLE_MENU
29+
PLUGIN_EDITOR_TITLE_MENU, PLUGIN_EDITOR_TITLE_RUN_MENU, PLUGIN_SCM_TITLE_MENU, PLUGIN_VIEW_TITLE_MENU
3030
} from './vscode-theia-menu-mappings';
3131
import { PluginMenuCommandAdapter, ReferenceCountingSet } from './plugin-menu-command-adapter';
3232
import { ContextKeyExpr } from '@theia/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey';
@@ -56,6 +56,7 @@ export class MenusContributionPointHandler {
5656
this.initialized = true;
5757
this.commandAdapterRegistry.registerAdapter(this.commandAdapter);
5858
this.tabBarToolbar.registerMenuDelegate(PLUGIN_EDITOR_TITLE_MENU, widget => this.codeEditorWidgetUtil.is(widget));
59+
this.tabBarToolbar.registerMenuDelegate(PLUGIN_EDITOR_TITLE_RUN_MENU, widget => this.codeEditorWidgetUtil.is(widget));
5960
this.tabBarToolbar.registerMenuDelegate(PLUGIN_SCM_TITLE_MENU, widget => widget instanceof ScmWidget);
6061
this.tabBarToolbar.registerMenuDelegate(PLUGIN_VIEW_TITLE_MENU, widget => widget instanceof PluginViewWidget);
6162
this.tabBarToolbar.registerItem({ id: 'plugin-menu-contribution-title-contribution', command: '_never_', onDidChange: this.onDidChangeTitleContributionEmitter.event });

packages/plugin-ext/src/main/browser/menus/plugin-menu-command-adapter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ export class PluginMenuCommandAdapter implements MenuCommandAdapter {
9494
['editor/context', selectedResource],
9595
['editor/title', widgetURI],
9696
['editor/title/context', selectedResource],
97+
['editor/title/run', widgetURI],
9798
['explorer/context', selectedResource],
9899
['scm/resourceFolder/context', toScmArgs],
99100
['scm/resourceGroup/context', toScmArgs],

packages/plugin-ext/src/main/browser/menus/vscode-theia-menu-mappings.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import { VIEW_ITEM_CONTEXT_MENU } from '../view/tree-view-widget';
3232
import { WebviewWidget } from '../webview/webview';
3333

3434
export const PLUGIN_EDITOR_TITLE_MENU = ['plugin_editor/title'];
35+
export const PLUGIN_EDITOR_TITLE_RUN_MENU = ['plugin_editor/title/run'];
3536
export const PLUGIN_SCM_TITLE_MENU = ['plugin_scm/title'];
3637
export const PLUGIN_VIEW_TITLE_MENU = ['plugin_view/title'];
3738

@@ -45,6 +46,7 @@ export const implementedVSCodeContributionPoints = [
4546
'editor/context',
4647
'editor/title',
4748
'editor/title/context',
49+
'editor/title/run',
4850
'explorer/context',
4951
'scm/resourceFolder/context',
5052
'scm/resourceGroup/context',
@@ -68,6 +70,7 @@ export const codeToTheiaMappings = new Map<ContributionPoint, MenuPath[]>([
6870
['editor/context', [EDITOR_CONTEXT_MENU]],
6971
['editor/title', [PLUGIN_EDITOR_TITLE_MENU]],
7072
['editor/title/context', [SHELL_TABBAR_CONTEXT_MENU]],
73+
['editor/title/run', [PLUGIN_EDITOR_TITLE_RUN_MENU]],
7174
['explorer/context', [NAVIGATOR_CONTEXT_MENU]],
7275
['scm/resourceFolder/context', [ScmTreeWidget.RESOURCE_FOLDER_CONTEXT_MENU]],
7376
['scm/resourceGroup/context', [ScmTreeWidget.RESOURCE_GROUP_CONTEXT_MENU]],

0 commit comments

Comments
 (0)