-
-
Notifications
You must be signed in to change notification settings - Fork 431
/
Copy pathcommon-frontend-contribution.ts
48 lines (45 loc) · 1.57 KB
/
common-frontend-contribution.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { injectable } from 'inversify';
import { MenuModelRegistry } from '@theia/core/lib/common/menu';
import {
CommonFrontendContribution as TheiaCommonFrontendContribution,
CommonCommands,
} from '@theia/core/lib/browser/common-frontend-contribution';
import { CommandRegistry } from '@theia/core/lib/common/command';
@injectable()
export class CommonFrontendContribution extends TheiaCommonFrontendContribution {
registerCommands(commandRegistry: CommandRegistry): void {
super.registerCommands(commandRegistry);
for (const command of [
CommonCommands.CONFIGURE_DISPLAY_LANGUAGE,
CommonCommands.CLOSE_TAB,
CommonCommands.CLOSE_SAVED_TABS,
CommonCommands.CLOSE_OTHER_TABS,
CommonCommands.CLOSE_ALL_TABS,
CommonCommands.COLLAPSE_PANEL,
CommonCommands.TOGGLE_MAXIMIZED,
]) {
commandRegistry.unregisterCommand(command);
}
}
registerMenus(registry: MenuModelRegistry): void {
super.registerMenus(registry);
for (const command of [
CommonCommands.SAVE,
CommonCommands.SAVE_ALL,
CommonCommands.CUT,
CommonCommands.COPY,
CommonCommands.PASTE,
CommonCommands.COPY_PATH,
CommonCommands.FIND,
CommonCommands.REPLACE,
CommonCommands.AUTO_SAVE,
CommonCommands.OPEN_PREFERENCES,
CommonCommands.SELECT_ICON_THEME,
CommonCommands.SELECT_COLOR_THEME,
CommonCommands.ABOUT_COMMAND,
CommonCommands.SAVE_WITHOUT_FORMATTING, // Patched for https://github.com/eclipse-theia/theia/pull/8877
]) {
registry.unregisterMenuAction(command);
}
}
}