Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 68e58d5

Browse files
author
Akos Kitta
committed
Removed File > Close Editor.
Closes #660 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
1 parent 883796f commit 68e58d5

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

‎arduino-ide-extension/src/browser/arduino-ide-frontend-module.ts

Lines changed: 6 additions & 0 deletions
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(
Lines changed: 12 additions & 0 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /