Skip to content

Commit 1bc202d

Browse files
author
Akos Kitta
committed
Removed File > Close Editor.
Closes #660 Signed-off-by: Akos Kitta <[email protected]>
1 parent 20020dc commit 1bc202d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Diff for: arduino-ide-extension/src/browser/arduino-ide-frontend-module.ts

+6
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ import { MonacoThemeServiceIsReady } from './utils/window';
321321
import { Deferred } from '@theia/core/lib/common/promise-util';
322322
import { StatusBarImpl } from './theia/core/status-bar';
323323
import { StatusBarImpl as TheiaStatusBarImpl } from '@theia/core/lib/browser';
324+
import { EditorMenuContribution } from './theia/editor/editor-file';
325+
import { EditorMenuContribution as TheiaEditorMenuContribution } from '@theia/editor/lib/browser/editor-menu';
324326

325327
const registerArduinoThemes = () => {
326328
const themes: MonacoThemeJson[] = [
@@ -640,6 +642,10 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
640642
bind(WindowContribution).toSelf().inSingletonScope();
641643
rebind(TheiaWindowContribution).toService(WindowContribution);
642644

645+
// To remove `File` > `Close Editor`.
646+
bind(EditorMenuContribution).toSelf().inSingletonScope();
647+
rebind(TheiaEditorMenuContribution).toService(EditorMenuContribution);
648+
643649
bind(ArduinoDaemon)
644650
.toDynamicValue((context) =>
645651
WebSocketConnectionProvider.createProxy(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { MenuModelRegistry } from '@theia/core';
2+
import { CommonCommands } from '@theia/core/lib/browser';
3+
import { injectable } from '@theia/core/shared/inversify';
4+
import { EditorMenuContribution as TheiaEditorMenuContribution } from '@theia/editor/lib/browser/editor-menu';
5+
6+
@injectable()
7+
export class EditorMenuContribution extends TheiaEditorMenuContribution {
8+
override registerMenus(registry: MenuModelRegistry): void {
9+
super.registerMenus(registry);
10+
registry.unregisterMenuAction(CommonCommands.CLOSE_MAIN_TAB.id);
11+
}
12+
}

0 commit comments

Comments
 (0)