Skip to content

Commit d288f3d

Browse files
authored
feat: editor tab support revealInExplorer (#2848)
1 parent 0f9e03b commit d288f3d

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

packages/editor/src/browser/editor.contribution.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,15 @@ export class EditorContribution
11721172
order: 3,
11731173
});
11741174

1175+
menus.registerMenuItem(MenuId.EditorTitleContext, {
1176+
command: {
1177+
id: FILE_COMMANDS.REVEAL_IN_EXPLORER.id,
1178+
label: localize('file.revealInExplorer'),
1179+
},
1180+
group: '6_file',
1181+
order: 3,
1182+
});
1183+
11751184
menus.registerMenuItem(MenuId.EditorTitleContext, {
11761185
command: EDITOR_COMMANDS.SPLIT_TO_LEFT.id,
11771186
group: '9_split',

packages/file-tree-next/src/browser/file-tree-contribution.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,9 @@ export class FileTreeContribution
937937
}
938938

939939
commands.registerCommand(FILE_COMMANDS.REVEAL_IN_EXPLORER, {
940-
execute: (uri?: URI) => {
940+
execute: (uriOrResource?: URI | { uri?: URI }) => {
941+
let uri = uriOrResource instanceof URI ? uriOrResource : uriOrResource?.uri;
942+
941943
const handler = this.mainLayoutService.getTabbarHandler(EXPLORER_CONTAINER_ID);
942944
if (handler && !handler.isVisible) {
943945
handler.activate();

0 commit comments

Comments
 (0)