Skip to content

Commit

Permalink
Deletion of Keybinding Context classes
Browse files Browse the repository at this point in the history
- `Blame Keybinding context` deletion
- `Terminal Keybinding context` deletion
- `Console Keybinding Context` deletion
- `Debug Keybinding Context` deletion
- `Editor Keybinding Context` deletion
- `Notification Keybinding Contribution` Deletetion
- `Navigator Keybinding Context` deletion

Signed-Off-By: FernandoAscencio <fernando.ascencio.cama@ericsson.com>
  • Loading branch information
FernandoAscencio committed Aug 30, 2023
1 parent 50b1e04 commit 06f8f36
Show file tree
Hide file tree
Showing 17 changed files with 11 additions and 476 deletions.
7 changes: 1 addition & 6 deletions packages/console/src/browser/console-frontend-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,14 @@

import { ContainerModule } from '@theia/core/shared/inversify';
import { CommandContribution, MenuContribution } from '@theia/core';
import { FrontendApplicationContribution, KeybindingContext, KeybindingContribution } from '@theia/core/lib/browser';
import { FrontendApplicationContribution, KeybindingContribution } from '@theia/core/lib/browser';
import { ConsoleContribution } from './console-contribution';
import { ConsoleManager } from './console-manager';
import { ConsoleInputFocusContext, ConsoleNavigationBackEnabled, ConsoleNavigationForwardEnabled, ConsoleContentFocusContext } from './console-keybinding-contexts';

import '../../src/browser/style/index.css';

export default new ContainerModule(bind => {
bind(ConsoleManager).toSelf().inSingletonScope();
bind(KeybindingContext).to(ConsoleInputFocusContext).inSingletonScope();
bind(KeybindingContext).to(ConsoleContentFocusContext).inSingletonScope();
bind(KeybindingContext).to(ConsoleNavigationBackEnabled).inSingletonScope();
bind(KeybindingContext).to(ConsoleNavigationForwardEnabled).inSingletonScope();
bind(ConsoleContribution).toSelf().inSingletonScope();
bind(FrontendApplicationContribution).toService(ConsoleContribution);
bind(CommandContribution).toService(ConsoleContribution);
Expand Down
107 changes: 0 additions & 107 deletions packages/console/src/browser/console-keybinding-contexts.ts

This file was deleted.

6 changes: 1 addition & 5 deletions packages/debug/src/browser/debug-frontend-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { DebugWidget } from './view/debug-widget';
import { DebugPath, DebugService } from '../common/debug-service';
import {
WidgetFactory, WebSocketConnectionProvider, FrontendApplicationContribution,
bindViewContribution, KeybindingContext
bindViewContribution
} from '@theia/core/lib/browser';
import { DebugSessionManager } from './debug-session-manager';
import { DebugResourceResolver } from './debug-resource';
Expand All @@ -39,7 +39,6 @@ import { DebugFrontendApplicationContribution } from './debug-frontend-applicati
import { DebugConsoleContribution } from './console/debug-console-contribution';
import { BreakpointManager } from './breakpoint/breakpoint-manager';
import { DebugEditorService } from './editor/debug-editor-service';
import { InDebugModeContext, BreakpointWidgetInputFocusContext, BreakpointWidgetInputStrictFocusContext } from './debug-keybinding-contexts';
import { DebugEditorModelFactory, DebugEditorModel } from './editor/debug-editor-model';
import { bindDebugPreferences } from './debug-preferences';
import { DebugSchemaUpdater } from './debug-schema-updater';
Expand Down Expand Up @@ -100,9 +99,6 @@ export default new ContainerModule((bind: interfaces.Bind) => {
bind(DebugResourceResolver).toSelf().inSingletonScope();
bind(ResourceResolver).toService(DebugResourceResolver);

bind(KeybindingContext).to(InDebugModeContext).inSingletonScope();
bind(KeybindingContext).to(BreakpointWidgetInputFocusContext).inSingletonScope();
bind(KeybindingContext).to(BreakpointWidgetInputStrictFocusContext).inSingletonScope();
bindViewContribution(bind, DebugFrontendApplicationContribution);
bind(FrontendApplicationContribution).toService(DebugFrontendApplicationContribution);
bind(TabBarToolbarContribution).toService(DebugFrontendApplicationContribution);
Expand Down
75 changes: 0 additions & 75 deletions packages/debug/src/browser/debug-keybinding-contexts.ts

This file was deleted.

7 changes: 1 addition & 6 deletions packages/editor/src/browser/editor-frontend-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ import '../../src/browser/language-status/editor-language-status.css';

import { ContainerModule } from '@theia/core/shared/inversify';
import { CommandContribution, MenuContribution } from '@theia/core/lib/common';
import { OpenHandler, WidgetFactory, FrontendApplicationContribution, KeybindingContext, KeybindingContribution } from '@theia/core/lib/browser';
import { OpenHandler, WidgetFactory, FrontendApplicationContribution, KeybindingContribution } from '@theia/core/lib/browser';
import { VariableContribution } from '@theia/variable-resolver/lib/browser';
import { EditorManager, EditorAccess, ActiveEditorAccess, CurrentEditorAccess } from './editor-manager';
import { EditorContribution } from './editor-contribution';
import { EditorMenuContribution } from './editor-menu';
import { EditorCommandContribution } from './editor-command';
import { EditorTextFocusContext, StrictEditorTextFocusContext, DiffEditorTextFocusContext } from './editor-keybinding-contexts';
import { EditorKeybindingContribution } from './editor-keybinding';
import { bindEditorPreferences } from './editor-preferences';
import { EditorWidgetFactory } from './editor-widget-factory';
Expand Down Expand Up @@ -54,10 +53,6 @@ export default new ContainerModule(bind => {
bind(EditorMenuContribution).toSelf().inSingletonScope();
bind(MenuContribution).toService(EditorMenuContribution);

bind(StrictEditorTextFocusContext).toSelf().inSingletonScope();
bind(KeybindingContext).toService(StrictEditorTextFocusContext);
bind(KeybindingContext).to(EditorTextFocusContext).inSingletonScope();
bind(KeybindingContext).to(DiffEditorTextFocusContext).inSingletonScope();
bind(EditorKeybindingContribution).toSelf().inSingletonScope();
bind(KeybindingContribution).toService(EditorKeybindingContribution);

Expand Down
87 changes: 0 additions & 87 deletions packages/editor/src/browser/editor-keybinding-contexts.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/editor/src/browser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export * from './editor-widget';
export * from './editor-manager';
export * from './editor-command';
export * from './editor-menu';
export * from './editor-keybinding-contexts';
export * from './editor-frontend-module';
export * from './editor-preferences';
export * from './decorations';
Expand Down
22 changes: 1 addition & 21 deletions packages/git/src/browser/blame/blame-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { inject, injectable, postConstruct } from '@theia/core/shared/inversify'
import { KeybindingContribution, KeybindingRegistry } from '@theia/core/lib/browser';
import { CommandContribution, CommandRegistry, Command, MenuContribution, MenuModelRegistry, DisposableCollection } from '@theia/core/lib/common';
import { BlameDecorator } from './blame-decorator';
import { EditorManager, EditorWidget, EditorTextFocusContext, StrictEditorTextFocusContext } from '@theia/editor/lib/browser';
import { EditorManager, EditorWidget } from '@theia/editor/lib/browser';
import { BlameManager } from './blame-manager';
import URI from '@theia/core/lib/common/uri';
import { EDITOR_CONTEXT_MENU_SCM } from '@theia/scm-extra/lib/browser/scm-extra-contribution';
Expand Down Expand Up @@ -185,23 +185,3 @@ export class BlameContribution implements CommandContribution, KeybindingContrib
}

}

@injectable()
export class BlameAnnotationsKeybindingContext extends EditorTextFocusContext {

@inject(BlameContribution)
protected readonly blameContribution: BlameContribution;

@inject(StrictEditorTextFocusContext)
protected readonly base: StrictEditorTextFocusContext;

override id = BlameAnnotationsKeybindingContext.showsBlameAnnotations;

protected override canHandle(widget: EditorWidget): boolean {
return this.base.isEnabled() && this.blameContribution.showsBlameAnnotations(widget.editor.uri);
}
}

export namespace BlameAnnotationsKeybindingContext {
export const showsBlameAnnotations = 'showsBlameAnnotations';
}
Loading

0 comments on commit 06f8f36

Please sign in to comment.