From e749f18d6fc98b609110d14d9f1b5c39fa0c9bf6 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Fri, 12 Aug 2016 16:53:59 +0200 Subject: [PATCH] Rename IKeybindingService -> IContextKeyService --- .../browser/standalone/simpleServices.ts | 6 ++-- .../standalone/standaloneCodeEditor.ts | 14 +++++----- .../browser/standalone/standaloneServices.ts | 18 ++++++------ src/vs/editor/browser/view/viewImpl.ts | 10 +++---- .../editor/browser/widget/codeEditorWidget.ts | 10 +++---- .../editor/browser/widget/diffEditorWidget.ts | 10 +++---- .../widget/embeddedCodeEditorWidget.ts | 6 ++-- src/vs/editor/common/commonCodeEditor.ts | 28 +++++++++---------- src/vs/editor/common/config/config.ts | 4 +-- src/vs/editor/common/editorAction.ts | 10 +++---- .../editor/common/modes/editorModeContext.ts | 26 ++++++++--------- .../accessibility/browser/accessibility.ts | 10 +++---- .../contextmenu/browser/contextmenu.ts | 6 ++-- src/vs/editor/contrib/find/browser/find.ts | 6 ++-- .../contrib/find/common/findController.ts | 6 ++-- .../contrib/gotoError/browser/gotoError.ts | 6 ++-- .../browser/parameterHintsWidget.ts | 8 +++--- .../contrib/quickFix/browser/quickFix.ts | 6 ++-- .../browser/referenceSearch.ts | 6 ++-- .../browser/referencesController.ts | 6 ++-- .../editor/contrib/rename/browser/rename.ts | 6 ++-- .../electron-browser/selectionClipboard.ts | 4 +-- .../editor/contrib/snippet/common/snippet.ts | 6 ++-- .../contrib/suggest/browser/suggestWidget.ts | 10 +++---- .../contrib/suggest/browser/tabCompletion.ts | 6 ++-- .../test/common/mocks/mockCodeEditor.ts | 10 +++---- src/vs/platform/actions/common/actions.ts | 4 +-- src/vs/platform/actions/common/menuService.ts | 14 +++++----- .../actions/common/resourceContextKey.ts | 10 +++---- .../actions/test/common/menuService.test.ts | 10 +++---- .../contextkey/browser/contextKeyService.ts | 10 +++---- .../platform/contextkey/common/contextkey.ts | 10 +++---- .../browser/keybindingServiceImpl.ts | 10 +++---- .../test/common/mockKeybindingService.ts | 6 ++-- .../parts/editor/sideBySideEditorControl.ts | 6 ++-- .../browser/parts/editor/tabsTitleControl.ts | 6 ++-- .../browser/parts/editor/textDiffEditor.ts | 6 ++-- .../browser/parts/editor/titleControl.ts | 6 ++-- .../parts/quickopen/quickOpenController.ts | 6 ++-- .../workbench/electron-browser/workbench.ts | 15 +++++----- .../parts/debug/browser/breakpointWidget.ts | 6 ++-- .../debug/electron-browser/debugService.ts | 6 ++-- .../parts/files/browser/explorerViewlet.ts | 6 ++-- .../files/browser/views/explorerViewer.ts | 6 ++-- .../parts/search/browser/searchViewlet.ts | 8 +++--- .../parts/search/browser/searchWidget.ts | 4 +-- .../electron-browser/terminalService.ts | 6 ++-- .../electron-browser/keybindingService.ts | 16 ++--------- 48 files changed, 206 insertions(+), 215 deletions(-) diff --git a/src/vs/editor/browser/standalone/simpleServices.ts b/src/vs/editor/browser/standalone/simpleServices.ts index 2522c23c3aa..c509466fe65 100644 --- a/src/vs/editor/browser/standalone/simpleServices.ts +++ b/src/vs/editor/browser/standalone/simpleServices.ts @@ -20,7 +20,7 @@ import {KeybindingService2} from 'vs/platform/keybinding/browser/keybindingServi import {KeybindingService} from 'vs/platform/contextkey/browser/contextKeyService'; import {IOSupport} from 'vs/platform/keybinding/common/keybindingResolver'; import {IKeybindingItem} from 'vs/platform/keybinding/common/keybinding'; -import {IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {IConfirmation, IMessageService} from 'vs/platform/message/common/message'; import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace'; import * as editorCommon from 'vs/editor/common/editorCommon'; @@ -208,12 +208,12 @@ export class StandaloneKeybindingService2 extends KeybindingService2 { private _dynamicCommands: { [id: string]: ICommandHandler }; constructor( - keybindingService: IKeybindingService, + contextKeyService: IContextKeyService, commandService: ICommandService, messageService: IMessageService, domNode: HTMLElement ) { - super(keybindingService, commandService, messageService); + super(contextKeyService, commandService, messageService); this._dynamicKeybindings = []; this._dynamicCommands = Object.create(null); diff --git a/src/vs/editor/browser/standalone/standaloneCodeEditor.ts b/src/vs/editor/browser/standalone/standaloneCodeEditor.ts index c42bae0922b..f62fde5036f 100644 --- a/src/vs/editor/browser/standalone/standaloneCodeEditor.ts +++ b/src/vs/editor/browser/standalone/standaloneCodeEditor.ts @@ -10,7 +10,7 @@ import {IContextViewService} from 'vs/platform/contextview/browser/contextView'; import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; import {ICommandService} from 'vs/platform/commands/common/commands'; import {IKeybindingService2} from 'vs/platform/keybinding/common/keybinding'; -import {IKeybindingContextKey, IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {IKeybindingContextKey, IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {ICommandHandler} from 'vs/platform/commands/common/commands'; import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {IActionDescriptor, ICodeEditorWidgetCreationOptions, IDiffEditorOptions, IModel, IModelChangedEvent, EventType} from 'vs/editor/common/editorCommon'; @@ -70,13 +70,13 @@ export class StandaloneEditor extends CodeEditorWidget implements IStandaloneCod @IInstantiationService instantiationService: IInstantiationService, @ICodeEditorService codeEditorService: ICodeEditorService, @ICommandService commandService: ICommandService, - @IKeybindingService keybindingService: IKeybindingService, + @IContextKeyService contextKeyService: IContextKeyService, @IKeybindingService2 keybindingService2: IKeybindingService2, @ITelemetryService telemetryService: ITelemetryService, @IContextViewService contextViewService: IContextViewService ) { options = options || {}; - super(domElement, options, instantiationService, codeEditorService, commandService, keybindingService.createScoped(domElement), telemetryService); + super(domElement, options, instantiationService, codeEditorService, commandService, contextKeyService.createScoped(domElement), telemetryService); if (keybindingService2 instanceof StandaloneKeybindingService2) { this._standaloneKeybindingService = keybindingService2; @@ -127,7 +127,7 @@ export class StandaloneEditor extends CodeEditorWidget implements IStandaloneCod console.warn('Cannot create context key because the editor is configured with an unrecognized KeybindingService'); return null; } - return this._keybindingService.createKey(key, defaultValue); + return this._contextKeyService.createKey(key, defaultValue); } public addAction(descriptor:IActionDescriptor): void { @@ -173,12 +173,12 @@ export class StandaloneDiffEditor extends DiffEditorWidget implements IStandalon options:IDiffEditorConstructionOptions, toDispose: IDisposable[], @IInstantiationService instantiationService: IInstantiationService, - @IKeybindingService keybindingService: IKeybindingService, + @IContextKeyService contextKeyService: IContextKeyService, @IKeybindingService2 keybindingService2: IKeybindingService2, @IContextViewService contextViewService: IContextViewService, @IEditorWorkerService editorWorkerService: IEditorWorkerService ) { - super(domElement, options, editorWorkerService, keybindingService, instantiationService); + super(domElement, options, editorWorkerService, contextKeyService, instantiationService); if (keybindingService2 instanceof StandaloneKeybindingService2) { this._standaloneKeybindingService = keybindingService2; @@ -213,7 +213,7 @@ export class StandaloneDiffEditor extends DiffEditorWidget implements IStandalon console.warn('Cannot create context key because the editor is configured with an unrecognized KeybindingService'); return null; } - return this._keybindingService.createKey(key, defaultValue); + return this._contextKeyService.createKey(key, defaultValue); } public addAction(descriptor:IActionDescriptor): void { diff --git a/src/vs/editor/browser/standalone/standaloneServices.ts b/src/vs/editor/browser/standalone/standaloneServices.ts index 0388c5810e1..4c1afc7c111 100644 --- a/src/vs/editor/browser/standalone/standaloneServices.ts +++ b/src/vs/editor/browser/standalone/standaloneServices.ts @@ -21,7 +21,7 @@ import {ICommandService} from 'vs/platform/commands/common/commands'; import {CommandService} from 'vs/platform/commands/common/commandService'; import {IOpenerService} from 'vs/platform/opener/common/opener'; import {IKeybindingService2} from 'vs/platform/keybinding/common/keybinding'; -import {IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {MarkerService} from 'vs/platform/markers/common/markerService'; import {IMarkerService} from 'vs/platform/markers/common/markers'; import {IMessageService} from 'vs/platform/message/common/message'; @@ -93,7 +93,7 @@ export interface IEditorOverrideServices { /** * @internal */ - keybindingService?:IKeybindingService; + contextKeyService?:IContextKeyService; /** * @internal */ @@ -194,16 +194,16 @@ export function ensureStaticPlatformServices(services: IEditorOverrideServices): export function ensureDynamicPlatformServices(domElement:HTMLElement, services: IEditorOverrideServices): IDisposable[] { let r:IDisposable[] = []; - let keybindingService:IKeybindingService; - if (typeof services.keybindingService === 'undefined') { - keybindingService = new StandaloneKeybindingService(services.configurationService); - r.push(keybindingService); - services.keybindingService = keybindingService; + let contextKeyService:IContextKeyService; + if (typeof services.contextKeyService === 'undefined') { + contextKeyService = new StandaloneKeybindingService(services.configurationService); + r.push(contextKeyService); + services.contextKeyService = contextKeyService; } else { - keybindingService = services.keybindingService; + contextKeyService = services.contextKeyService; } if (typeof services.keybindingService2 === 'undefined') { - let keybindingService2 = new StandaloneKeybindingService2(keybindingService, services.commandService, services.messageService, domElement); + let keybindingService2 = new StandaloneKeybindingService2(contextKeyService, services.commandService, services.messageService, domElement); r.push(keybindingService2); services.keybindingService2 = keybindingService2; } diff --git a/src/vs/editor/browser/view/viewImpl.ts b/src/vs/editor/browser/view/viewImpl.ts index 923cdc5d9e5..7f991832378 100644 --- a/src/vs/editor/browser/view/viewImpl.ts +++ b/src/vs/editor/browser/view/viewImpl.ts @@ -11,7 +11,7 @@ import * as timer from 'vs/base/common/timer'; import * as browser from 'vs/base/browser/browser'; import * as dom from 'vs/base/browser/dom'; import {StyleMutator} from 'vs/base/browser/styleMutator'; -import {IKeybindingContextKey, IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {IKeybindingContextKey, IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {ICommandService} from 'vs/platform/commands/common/commands'; import {Range} from 'vs/editor/common/core/range'; import * as editorCommon from 'vs/editor/common/editorCommon'; @@ -92,7 +92,7 @@ export class View extends ViewEventHandler implements editorBrowser.IView, IDisp private _editorTextFocusContextKey: IKeybindingContextKey; constructor( - keybindingService: IKeybindingService, + contextKeyService: IContextKeyService, commandService: ICommandService, configuration:Configuration, model:IViewModel, @@ -134,7 +134,7 @@ export class View extends ViewEventHandler implements editorBrowser.IView, IDisp (eventHandler:IViewEventHandler) => this.eventDispatcher.removeEventHandler(eventHandler) ); - this.createTextArea(keybindingService); + this.createTextArea(contextKeyService); this.createViewParts(); // Keyboard handler @@ -171,10 +171,10 @@ export class View extends ViewEventHandler implements editorBrowser.IView, IDisp } } - private createTextArea(keybindingService: IKeybindingService): void { + private createTextArea(contextKeyService: IContextKeyService): void { // Text Area (The focus will always be in the textarea when the cursor is blinking) this.textArea = document.createElement('textarea'); - this._editorTextFocusContextKey = EditorContextKeys.TextFocus.bindTo(keybindingService); + this._editorTextFocusContextKey = EditorContextKeys.TextFocus.bindTo(contextKeyService); this.textArea.className = editorBrowser.ClassNames.TEXTAREA; this.textArea.setAttribute('wrap', 'off'); this.textArea.setAttribute('autocorrect', 'off'); diff --git a/src/vs/editor/browser/widget/codeEditorWidget.ts b/src/vs/editor/browser/widget/codeEditorWidget.ts index 6c68919ed57..b707bf4bd13 100644 --- a/src/vs/editor/browser/widget/codeEditorWidget.ts +++ b/src/vs/editor/browser/widget/codeEditorWidget.ts @@ -12,7 +12,7 @@ import * as browser from 'vs/base/browser/browser'; import * as dom from 'vs/base/browser/dom'; import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; import {ICommandService} from 'vs/platform/commands/common/commands'; -import {IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {CommonCodeEditor} from 'vs/editor/common/commonCodeEditor'; import {CommonEditorConfiguration} from 'vs/editor/common/config/commonEditorConfig'; @@ -77,10 +77,10 @@ export class CodeEditorWidget extends CommonCodeEditor implements editorBrowser. @IInstantiationService instantiationService: IInstantiationService, @ICodeEditorService codeEditorService: ICodeEditorService, @ICommandService commandService: ICommandService, - @IKeybindingService keybindingService: IKeybindingService, + @IContextKeyService contextKeyService: IContextKeyService, @ITelemetryService telemetryService: ITelemetryService ) { - super(domElement, options, instantiationService, codeEditorService, commandService, keybindingService, telemetryService); + super(domElement, options, instantiationService, codeEditorService, commandService, contextKeyService, telemetryService); this._focusTracker = new CodeEditorWidgetFocusTracker(domElement); this._focusTracker.onChage(() => { @@ -109,7 +109,7 @@ export class CodeEditorWidget extends CommonCodeEditor implements editorBrowser. } CommonEditorRegistry.getEditorActions().forEach((action) => { - let internalAction = new InternalEditorAction(action, this, this._instantiationService, this._keybindingService); + let internalAction = new InternalEditorAction(action, this, this._instantiationService, this._contextKeyService); this._actions[internalAction.id] = internalAction; }); } @@ -507,7 +507,7 @@ export class CodeEditorWidget extends CommonCodeEditor implements editorBrowser. protected _createView(): void { this._view = new View( - this._keybindingService, + this._contextKeyService, this._commandService, this._configuration, this.viewModel, diff --git a/src/vs/editor/browser/widget/diffEditorWidget.ts b/src/vs/editor/browser/widget/diffEditorWidget.ts index 5e36d837384..167475bc9d3 100644 --- a/src/vs/editor/browser/widget/diffEditorWidget.ts +++ b/src/vs/editor/browser/widget/diffEditorWidget.ts @@ -14,7 +14,7 @@ import * as dom from 'vs/base/browser/dom'; import {StyleMutator} from 'vs/base/browser/styleMutator'; import {ISashEvent, IVerticalSashLayoutProvider, Sash} from 'vs/base/browser/ui/sash/sash'; import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; -import {IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {ServiceCollection} from 'vs/platform/instantiation/common/serviceCollection'; import {DefaultConfig} from 'vs/editor/common/config/defaultConfig'; import {Range} from 'vs/editor/common/core/range'; @@ -204,18 +204,18 @@ export class DiffEditorWidget extends EventEmitter implements editorBrowser.IDif private _updateDecorationsRunner:RunOnceScheduler; private _editorWorkerService: IEditorWorkerService; - protected _keybindingService: IKeybindingService; + protected _contextKeyService: IContextKeyService; constructor( domElement:HTMLElement, options:editorCommon.IDiffEditorOptions, @IEditorWorkerService editorWorkerService: IEditorWorkerService, - @IKeybindingService keybindingService: IKeybindingService, + @IContextKeyService contextKeyService: IContextKeyService, @IInstantiationService instantiationService: IInstantiationService ) { super(); this._editorWorkerService = editorWorkerService; - this._keybindingService = keybindingService; + this._contextKeyService = contextKeyService; this.id = (++DIFF_EDITOR_ID); @@ -357,7 +357,7 @@ export class DiffEditorWidget extends EventEmitter implements editorBrowser.IDif } private _createLeftHandSideEditor(options: editorCommon.IDiffEditorOptions, instantiationService: IInstantiationService): void { - instantiationService = instantiationService.createChild(new ServiceCollection([IKeybindingService, this._keybindingService.createScoped(this._originalDomNode)])); + instantiationService = instantiationService.createChild(new ServiceCollection([IContextKeyService, this._contextKeyService.createScoped(this._originalDomNode)])); this.originalEditor = instantiationService.createInstance(CodeEditorWidget, this._originalDomNode, this._adjustOptionsForLeftHandSide(options, this._originalIsEditable)); this._toDispose.push(this.originalEditor.addBulkListener2((events) => this._onOriginalEditorEvents(events))); this._toDispose.push(this.addEmitter2(this.originalEditor)); diff --git a/src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts b/src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts index 129ef0eaf26..74006803654 100644 --- a/src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts +++ b/src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts @@ -7,7 +7,7 @@ import * as objects from 'vs/base/common/objects'; import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; import {ICommandService} from 'vs/platform/commands/common/commands'; -import {IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {ICodeEditorWidgetCreationOptions, IConfigurationChangedEvent, IEditorOptions} from 'vs/editor/common/editorCommon'; import {ICodeEditorService} from 'vs/editor/common/services/codeEditorService'; @@ -26,10 +26,10 @@ export class EmbeddedCodeEditorWidget extends CodeEditorWidget { @IInstantiationService instantiationService: IInstantiationService, @ICodeEditorService codeEditorService: ICodeEditorService, @ICommandService commandService: ICommandService, - @IKeybindingService keybindingService: IKeybindingService, + @IContextKeyService contextKeyService: IContextKeyService, @ITelemetryService telemetryService: ITelemetryService ) { - super(domElement, parentEditor.getRawConfiguration(), instantiationService, codeEditorService, commandService, keybindingService.createScoped(domElement), telemetryService); + super(domElement, parentEditor.getRawConfiguration(), instantiationService, codeEditorService, commandService, contextKeyService.createScoped(domElement), telemetryService); this._parentEditor = parentEditor; this._overwriteOptions = options; diff --git a/src/vs/editor/common/commonCodeEditor.ts b/src/vs/editor/common/commonCodeEditor.ts index 722a43fb8a4..45316b88d55 100644 --- a/src/vs/editor/common/commonCodeEditor.ts +++ b/src/vs/editor/common/commonCodeEditor.ts @@ -12,7 +12,7 @@ import {TPromise} from 'vs/base/common/winjs.base'; import {ServicesAccessor, IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; import {ServiceCollection} from 'vs/platform/instantiation/common/serviceCollection'; import {ICommandService} from 'vs/platform/commands/common/commands'; -import {IKeybindingContextKey, IKeybindingScopeLocation, IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {IKeybindingContextKey, IKeybindingScopeLocation, IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {CommonEditorConfiguration} from 'vs/editor/common/config/commonEditorConfig'; import {DefaultConfig} from 'vs/editor/common/config/defaultConfig'; @@ -106,7 +106,7 @@ export abstract class CommonCodeEditor extends EventEmitter implements editorCom protected _instantiationService: IInstantiationService; protected _commandService: ICommandService; - protected _keybindingService: IKeybindingService; + protected _contextKeyService: IContextKeyService; /** * map from "parent" decoration type to live decoration ids. @@ -129,7 +129,7 @@ export abstract class CommonCodeEditor extends EventEmitter implements editorCom instantiationService: IInstantiationService, codeEditorService: ICodeEditorService, commandService: ICommandService, - keybindingService: IKeybindingService, + contextKeyService: IContextKeyService, telemetryService: ITelemetryService ) { super(); @@ -145,15 +145,15 @@ export abstract class CommonCodeEditor extends EventEmitter implements editorCom this._lifetimeDispose = []; this._commandService = commandService; - this._keybindingService = keybindingService; - this._editorIdContextKey = this._keybindingService.createKey('editorId', this.getId()); - this._editorFocusContextKey = EditorContextKeys.Focus.bindTo(this._keybindingService); - this._editorTabMovesFocusKey = EditorContextKeys.TabMovesFocus.bindTo(this._keybindingService); - this._editorReadonly = EditorContextKeys.ReadOnly.bindTo(this._keybindingService); - this._hasMultipleSelectionsKey = EditorContextKeys.HasMultipleSelections.bindTo(this._keybindingService); - this._hasNonEmptySelectionKey = EditorContextKeys.HasNonEmptySelection.bindTo(this._keybindingService); - this._langIdKey = EditorContextKeys.LanguageId.bindTo(this._keybindingService); - this._lifetimeDispose.push(new EditorModeContext(this, this._keybindingService)); + this._contextKeyService = contextKeyService; + this._editorIdContextKey = this._contextKeyService.createKey('editorId', this.getId()); + this._editorFocusContextKey = EditorContextKeys.Focus.bindTo(this._contextKeyService); + this._editorTabMovesFocusKey = EditorContextKeys.TabMovesFocus.bindTo(this._contextKeyService); + this._editorReadonly = EditorContextKeys.ReadOnly.bindTo(this._contextKeyService); + this._hasMultipleSelectionsKey = EditorContextKeys.HasMultipleSelections.bindTo(this._contextKeyService); + this._hasNonEmptySelectionKey = EditorContextKeys.HasNonEmptySelection.bindTo(this._contextKeyService); + this._langIdKey = EditorContextKeys.LanguageId.bindTo(this._contextKeyService); + this._lifetimeDispose.push(new EditorModeContext(this, this._contextKeyService)); this._decorationTypeKeysToIds = {}; this._decorationTypeSubtypes = {}; @@ -178,7 +178,7 @@ export abstract class CommonCodeEditor extends EventEmitter implements editorCom })); this._telemetryService = telemetryService; - this._instantiationService = instantiationService.createChild(new ServiceCollection([IKeybindingService, this._keybindingService])); + this._instantiationService = instantiationService.createChild(new ServiceCollection([IContextKeyService, this._contextKeyService])); this._attachModel(null); @@ -220,7 +220,7 @@ export abstract class CommonCodeEditor extends EventEmitter implements editorCom this._postDetachModelCleanup(this._detachModel()); this._configuration.dispose(); - this._keybindingService.dispose(); + this._contextKeyService.dispose(); this.emit(editorCommon.EventType.Disposed); super.dispose(); } diff --git a/src/vs/editor/common/config/config.ts b/src/vs/editor/common/config/config.ts index e8d84488739..106475f7522 100644 --- a/src/vs/editor/common/config/config.ts +++ b/src/vs/editor/common/config/config.ts @@ -9,7 +9,7 @@ import {KeyCode, KeyMod} from 'vs/base/common/keyCodes'; import {IEditorService} from 'vs/platform/editor/common/editor'; import {ServicesAccessor} from 'vs/platform/instantiation/common/instantiation'; import {IKeybindings} from 'vs/platform/keybinding/common/keybinding'; -import {IKeybindingService, KbExpr} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService, KbExpr} from 'vs/platform/contextkey/common/contextkey'; import {ICommandAndKeybindingRule, KeybindingsRegistry} from 'vs/platform/keybinding/common/keybindingsRegistry'; import * as editorCommon from 'vs/editor/common/editorCommon'; import {ICodeEditorService} from 'vs/editor/common/services/codeEditorService'; @@ -112,7 +112,7 @@ export abstract class EditorCommand extends Command { return; } return editor.invokeWithinContext((editorAccessor) => { - const kbService = editorAccessor.get(IKeybindingService); + const kbService = editorAccessor.get(IContextKeyService); if (!kbService.contextMatchesRules(this.precondition)) { // precondition does not hold return; diff --git a/src/vs/editor/common/editorAction.ts b/src/vs/editor/common/editorAction.ts index 0fdba65a057..97369698490 100644 --- a/src/vs/editor/common/editorAction.ts +++ b/src/vs/editor/common/editorAction.ts @@ -8,7 +8,7 @@ import {TPromise} from 'vs/base/common/winjs.base'; import {IActionDescriptor, ICommonCodeEditor, IEditorAction} from 'vs/editor/common/editorCommon'; import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; import {EditorAction} from 'vs/editor/common/editorCommonExtensions'; -import {IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; export abstract class AbstractInternalEditorAction { @@ -29,22 +29,22 @@ export class InternalEditorAction extends AbstractInternalEditorAction implement private _actual: EditorAction; private _instantiationService:IInstantiationService; - private _keybindingService:IKeybindingService; + private _contextKeyService:IContextKeyService; constructor( actual:EditorAction, editor:ICommonCodeEditor, @IInstantiationService instantiationService:IInstantiationService, - @IKeybindingService keybindingService:IKeybindingService + @IContextKeyService contextKeyService:IContextKeyService ) { super(actual.id, actual.label, actual.alias, editor); this._actual = actual; this._instantiationService = instantiationService; - this._keybindingService = keybindingService; + this._contextKeyService = contextKeyService; } public isSupported():boolean { - return this._keybindingService.contextMatchesRules(this._actual.precondition); + return this._contextKeyService.contextMatchesRules(this._actual.precondition); } public run(): TPromise { diff --git a/src/vs/editor/common/modes/editorModeContext.ts b/src/vs/editor/common/modes/editorModeContext.ts index 619bfd00cbd..dd85aa1990b 100644 --- a/src/vs/editor/common/modes/editorModeContext.ts +++ b/src/vs/editor/common/modes/editorModeContext.ts @@ -5,7 +5,7 @@ 'use strict'; import {IDisposable, dispose} from 'vs/base/common/lifecycle'; -import {IKeybindingContextKey, IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {IKeybindingContextKey, IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import * as modes from 'vs/editor/common/modes'; import {ICommonCodeEditor, ModeContextKeys} from 'vs/editor/common/editorCommon'; @@ -28,21 +28,21 @@ export class EditorModeContext { constructor( editor: ICommonCodeEditor, - keybindingService: IKeybindingService + contextKeyService: IContextKeyService ) { this._editor = editor; - this._hasCompletionItemProvider = ModeContextKeys.hasCompletionItemProvider.bindTo(keybindingService); - this._hasCodeActionsProvider = ModeContextKeys.hasCodeActionsProvider.bindTo(keybindingService); - this._hasCodeLensProvider = ModeContextKeys.hasCodeLensProvider.bindTo(keybindingService); - this._hasDefinitionProvider = ModeContextKeys.hasDefinitionProvider.bindTo(keybindingService); - this._hasHoverProvider = ModeContextKeys.hasHoverProvider.bindTo(keybindingService); - this._hasDocumentHighlightProvider = ModeContextKeys.hasDocumentHighlightProvider.bindTo(keybindingService); - this._hasDocumentSymbolProvider = ModeContextKeys.hasDocumentSymbolProvider.bindTo(keybindingService); - this._hasReferenceProvider = ModeContextKeys.hasReferenceProvider.bindTo(keybindingService); - this._hasRenameProvider = ModeContextKeys.hasRenameProvider.bindTo(keybindingService); - this._hasFormattingProvider = ModeContextKeys.hasFormattingProvider.bindTo(keybindingService); - this._hasSignatureHelpProvider = ModeContextKeys.hasSignatureHelpProvider.bindTo(keybindingService); + this._hasCompletionItemProvider = ModeContextKeys.hasCompletionItemProvider.bindTo(contextKeyService); + this._hasCodeActionsProvider = ModeContextKeys.hasCodeActionsProvider.bindTo(contextKeyService); + this._hasCodeLensProvider = ModeContextKeys.hasCodeLensProvider.bindTo(contextKeyService); + this._hasDefinitionProvider = ModeContextKeys.hasDefinitionProvider.bindTo(contextKeyService); + this._hasHoverProvider = ModeContextKeys.hasHoverProvider.bindTo(contextKeyService); + this._hasDocumentHighlightProvider = ModeContextKeys.hasDocumentHighlightProvider.bindTo(contextKeyService); + this._hasDocumentSymbolProvider = ModeContextKeys.hasDocumentSymbolProvider.bindTo(contextKeyService); + this._hasReferenceProvider = ModeContextKeys.hasReferenceProvider.bindTo(contextKeyService); + this._hasRenameProvider = ModeContextKeys.hasRenameProvider.bindTo(contextKeyService); + this._hasFormattingProvider = ModeContextKeys.hasFormattingProvider.bindTo(contextKeyService); + this._hasSignatureHelpProvider = ModeContextKeys.hasSignatureHelpProvider.bindTo(contextKeyService); // update when model/mode changes this._disposables.push(editor.onDidChangeModel(() => this._update())); diff --git a/src/vs/editor/contrib/accessibility/browser/accessibility.ts b/src/vs/editor/contrib/accessibility/browser/accessibility.ts index f4bb0e4453b..cd66e3babe4 100644 --- a/src/vs/editor/contrib/accessibility/browser/accessibility.ts +++ b/src/vs/editor/contrib/accessibility/browser/accessibility.ts @@ -16,7 +16,7 @@ import {StyleMutator} from 'vs/base/browser/styleMutator'; import {Widget} from 'vs/base/browser/ui/widget'; import {ServicesAccessor} from 'vs/platform/instantiation/common/instantiation'; import {IKeybindingService2} from 'vs/platform/keybinding/common/keybinding'; -import {KbCtxKey, IKeybindingContextKey, IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {KbCtxKey, IKeybindingContextKey, IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {KeybindingsRegistry} from 'vs/platform/keybinding/common/keybindingsRegistry'; import {GlobalScreenReaderNVDA} from 'vs/editor/common/config/commonEditorConfig'; import {ICommonCodeEditor, IEditorContribution, EditorContextKeys} from 'vs/editor/common/editorCommon'; @@ -41,13 +41,13 @@ class AccessibilityHelpController extends Disposable implements IEditorContribut constructor( editor:ICodeEditor, - @IKeybindingService keybindingService: IKeybindingService, + @IContextKeyService contextKeyService: IContextKeyService, @IKeybindingService2 keybindingService2: IKeybindingService2 ) { super(); this._editor = editor; - this._widget = this._register(new AccessibilityHelpWidget(this._editor, keybindingService, keybindingService2)); + this._widget = this._register(new AccessibilityHelpWidget(this._editor, contextKeyService, keybindingService2)); } public getId(): string { @@ -75,12 +75,12 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget { private _isVisible: boolean; private _isVisibleKey: IKeybindingContextKey; - constructor(editor:ICodeEditor, keybindingService: IKeybindingService, keybindingService2: IKeybindingService2) { + constructor(editor:ICodeEditor, contextKeyService: IContextKeyService, keybindingService2: IKeybindingService2) { super(); this._editor = editor; this._keybindingService2 = keybindingService2; - this._isVisibleKey = CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE.bindTo(keybindingService); + this._isVisibleKey = CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE.bindTo(contextKeyService); this._domNode = document.createElement('div'); this._domNode.className = 'accessibilityHelpWidget'; diff --git a/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts b/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts index f7701f13184..167346ed5f4 100644 --- a/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts +++ b/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts @@ -14,7 +14,7 @@ import {IKeyboardEvent} from 'vs/base/browser/keyboardEvent'; import {ActionItem, Separator} from 'vs/base/browser/ui/actionbar/actionbar'; import {IContextMenuService, IContextViewService} from 'vs/platform/contextview/browser/contextView'; import {IKeybindingService2} from 'vs/platform/keybinding/common/keybinding'; -import {IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {IMenuService, IMenu, MenuId} from 'vs/platform/actions/common/actions'; import {ICommonCodeEditor, IEditorContribution, MouseTargetType, EditorContextKeys} from 'vs/editor/common/editorCommon'; import {editorAction, ServicesAccessor, EditorAction} from 'vs/editor/common/editorCommonExtensions'; @@ -43,13 +43,13 @@ class ContextMenuController implements IEditorContribution { editor: ICodeEditor, @IContextMenuService private _contextMenuService: IContextMenuService, @IContextViewService private _contextViewService: IContextViewService, - @IKeybindingService private _keybindingService: IKeybindingService, + @IContextKeyService private _contextKeyService: IContextKeyService, @IKeybindingService2 private _keybindingService2: IKeybindingService2, @IMenuService private _menuService: IMenuService ) { this._editor = editor; - this._contextMenu = this._menuService.createMenu(MenuId.EditorContext, this._keybindingService); + this._contextMenu = this._menuService.createMenu(MenuId.EditorContext, this._contextKeyService); this._toDispose.push(this._contextMenu); this._toDispose.push(this._editor.onContextMenu((e: IEditorMouseEvent) => this._onContextMenu(e))); diff --git a/src/vs/editor/contrib/find/browser/find.ts b/src/vs/editor/contrib/find/browser/find.ts index 31229bb9f33..1dbf4671c1e 100644 --- a/src/vs/editor/contrib/find/browser/find.ts +++ b/src/vs/editor/contrib/find/browser/find.ts @@ -6,7 +6,7 @@ import {IContextViewService} from 'vs/platform/contextview/browser/contextView'; import {IKeybindingService2} from 'vs/platform/keybinding/common/keybinding'; -import {IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {ICodeEditor} from 'vs/editor/browser/editorBrowser'; import {EditorBrowserRegistry} from 'vs/editor/browser/editorBrowserExtensions'; import {FindWidget, IFindController} from 'vs/editor/contrib/find/browser/findWidget'; @@ -19,10 +19,10 @@ class FindController extends CommonFindController implements IFindController { constructor( editor:ICodeEditor, @IContextViewService contextViewService: IContextViewService, - @IKeybindingService keybindingService: IKeybindingService, + @IContextKeyService contextKeyService: IContextKeyService, @IKeybindingService2 keybindingService2: IKeybindingService2 ) { - super(editor, keybindingService); + super(editor, contextKeyService); this._widget = this._register(new FindWidget(editor, this, this._state, contextViewService, keybindingService2)); } diff --git a/src/vs/editor/contrib/find/common/findController.ts b/src/vs/editor/contrib/find/common/findController.ts index d4aa8540d8a..b8541c769af 100644 --- a/src/vs/editor/contrib/find/common/findController.ts +++ b/src/vs/editor/contrib/find/common/findController.ts @@ -7,7 +7,7 @@ import * as nls from 'vs/nls'; import {KeyCode, KeyMod} from 'vs/base/common/keyCodes'; import {Disposable} from 'vs/base/common/lifecycle'; -import {KbExpr, KbCtxKey, IKeybindingContextKey, IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {KbExpr, KbCtxKey, IKeybindingContextKey, IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {Range} from 'vs/editor/common/core/range'; import {Selection} from 'vs/editor/common/core/selection'; import * as strings from 'vs/base/common/strings'; @@ -49,10 +49,10 @@ export class CommonFindController extends Disposable implements editorCommon.IEd return editor.getContribution(CommonFindController.ID); } - constructor(editor:editorCommon.ICommonCodeEditor, @IKeybindingService keybindingService: IKeybindingService) { + constructor(editor:editorCommon.ICommonCodeEditor, @IContextKeyService contextKeyService: IContextKeyService) { super(); this._editor = editor; - this._findWidgetVisible = CONTEXT_FIND_WIDGET_VISIBLE.bindTo(keybindingService); + this._findWidgetVisible = CONTEXT_FIND_WIDGET_VISIBLE.bindTo(contextKeyService); this._state = this._register(new FindReplaceState()); this._register(this._state.addChangeListener((e) => this._onStateChanged(e))); diff --git a/src/vs/editor/contrib/gotoError/browser/gotoError.ts b/src/vs/editor/contrib/gotoError/browser/gotoError.ts index 54486ab95a4..2ac4a4169cd 100644 --- a/src/vs/editor/contrib/gotoError/browser/gotoError.ts +++ b/src/vs/editor/contrib/gotoError/browser/gotoError.ts @@ -17,7 +17,7 @@ import {TPromise} from 'vs/base/common/winjs.base'; import * as dom from 'vs/base/browser/dom'; import {renderHtml} from 'vs/base/browser/htmlContentRenderer'; import {ICommandService} from 'vs/platform/commands/common/commands'; -import {KbCtxKey, IKeybindingContextKey, IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {KbCtxKey, IKeybindingContextKey, IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {IMarker, IMarkerService} from 'vs/platform/markers/common/markers'; import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {Position} from 'vs/editor/common/core/position'; @@ -450,11 +450,11 @@ class MarkerController implements editorCommon.IEditorContribution { constructor( editor: ICodeEditor, @IMarkerService private _markerService: IMarkerService, - @IKeybindingService private _keybindingService: IKeybindingService, + @IContextKeyService private _contextKeyService: IContextKeyService, @ICommandService private _commandService: ICommandService ) { this._editor = editor; - this._markersNavigationVisible = CONTEXT_MARKERS_NAVIGATION_VISIBLE.bindTo(this._keybindingService); + this._markersNavigationVisible = CONTEXT_MARKERS_NAVIGATION_VISIBLE.bindTo(this._contextKeyService); } public getId(): string { diff --git a/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts b/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts index 32378c4f119..1c192d418ff 100644 --- a/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts +++ b/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts @@ -17,7 +17,7 @@ import { RunOnceScheduler } from 'vs/base/common/async'; import { onUnexpectedError } from 'vs/base/common/errors'; import Event, {Emitter} from 'vs/base/common/event'; import { ICommonCodeEditor, ICursorSelectionChangedEvent } from 'vs/editor/common/editorCommon'; -import { IKeybindingContextKey, IKeybindingService } from 'vs/platform/contextkey/common/contextkey'; +import { IKeybindingContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { Context, provideSignatureHelp } from '../common/parameterHints'; const $ = dom.emmet; @@ -176,10 +176,10 @@ export class ParameterHintsWidget implements IContentWidget, IDisposable { // Editor.IContentWidget.allowEditorOverflow allowEditorOverflow = true; - constructor(private editor: ICodeEditor, @IKeybindingService keybindingService: IKeybindingService) { + constructor(private editor: ICodeEditor, @IContextKeyService contextKeyService: IContextKeyService) { this.model = new ParameterHintsModel(editor); - this.keyVisible = Context.Visible.bindTo(keybindingService); - this.keyMultipleSignatures = Context.MultipleSignatures.bindTo(keybindingService); + this.keyVisible = Context.Visible.bindTo(contextKeyService); + this.keyMultipleSignatures = Context.MultipleSignatures.bindTo(contextKeyService); this.visible = false; this.disposables = []; diff --git a/src/vs/editor/contrib/quickFix/browser/quickFix.ts b/src/vs/editor/contrib/quickFix/browser/quickFix.ts index 1448b9ce020..995f2a6176a 100644 --- a/src/vs/editor/contrib/quickFix/browser/quickFix.ts +++ b/src/vs/editor/contrib/quickFix/browser/quickFix.ts @@ -9,7 +9,7 @@ import {onUnexpectedError} from 'vs/base/common/errors'; import {KeyCode, KeyMod} from 'vs/base/common/keyCodes'; import {IEditorService} from 'vs/platform/editor/common/editor'; import {ICommandService} from 'vs/platform/commands/common/commands'; -import {KbExpr, KbCtxKey, IKeybindingContextKey, IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {KbExpr, KbCtxKey, IKeybindingContextKey, IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {IMarkerService} from 'vs/platform/markers/common/markers'; import {IMessageService} from 'vs/platform/message/common/message'; import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; @@ -36,7 +36,7 @@ export class QuickFixController implements IEditorContribution { constructor(editor: ICodeEditor, @IMarkerService private _markerService: IMarkerService, - @IKeybindingService private _keybindingService: IKeybindingService, + @IContextKeyService private _contextKeyService: IContextKeyService, @ICommandService private _commandService: ICommandService, @ITelemetryService telemetryService: ITelemetryService, @IEditorService editorService: IEditorService, @@ -45,7 +45,7 @@ export class QuickFixController implements IEditorContribution { this.editor = editor; this.model = new QuickFixModel(this.editor, this._markerService, this.onAccept.bind(this)); - this.quickFixWidgetVisible = CONTEXT_QUICK_FIX_WIDGET_VISIBLE.bindTo(this._keybindingService); + this.quickFixWidgetVisible = CONTEXT_QUICK_FIX_WIDGET_VISIBLE.bindTo(this._contextKeyService); this.suggestWidget = new QuickFixSelectionWidget(this.editor, telemetryService,() => { this.quickFixWidgetVisible.set(true); },() => { diff --git a/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.ts b/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.ts index 58d1dbf6759..0c3c8e5a64b 100644 --- a/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.ts +++ b/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.ts @@ -11,7 +11,7 @@ import {TPromise} from 'vs/base/common/winjs.base'; import {IEditorService} from 'vs/platform/editor/common/editor'; import {optional} from 'vs/platform/instantiation/common/instantiation'; import {CommandsRegistry, ICommandHandler} from 'vs/platform/commands/common/commands'; -import {IKeybindingService, KbExpr} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService, KbExpr} from 'vs/platform/contextkey/common/contextkey'; import {KeybindingsRegistry} from 'vs/platform/keybinding/common/keybindingsRegistry'; import {Position} from 'vs/editor/common/core/position'; import {Range} from 'vs/editor/common/core/range'; @@ -38,11 +38,11 @@ export class ReferenceController implements editorCommon.IEditorContribution { constructor( editor:editorCommon.ICommonCodeEditor, - @IKeybindingService keybindingService: IKeybindingService, + @IContextKeyService contextKeyService: IContextKeyService, @optional(IPeekViewService) peekViewService: IPeekViewService ) { if (peekViewService) { - PeekContext.inPeekEditor.bindTo(keybindingService); + PeekContext.inPeekEditor.bindTo(contextKeyService); } } diff --git a/src/vs/editor/contrib/referenceSearch/browser/referencesController.ts b/src/vs/editor/contrib/referenceSearch/browser/referencesController.ts index f7634fedb05..36fe4f852fb 100644 --- a/src/vs/editor/contrib/referenceSearch/browser/referencesController.ts +++ b/src/vs/editor/contrib/referenceSearch/browser/referencesController.ts @@ -11,7 +11,7 @@ import Severity from 'vs/base/common/severity'; import {TPromise} from 'vs/base/common/winjs.base'; import {IEditorService} from 'vs/platform/editor/common/editor'; import {IInstantiationService, optional} from 'vs/platform/instantiation/common/instantiation'; -import {IKeybindingContextKey, IKeybindingService, KbCtxKey} from 'vs/platform/contextkey/common/contextkey'; +import {IKeybindingContextKey, IContextKeyService, KbCtxKey} from 'vs/platform/contextkey/common/contextkey'; import {IMessageService} from 'vs/platform/message/common/message'; import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {IConfigurationService, getConfigurationValue} from 'vs/platform/configuration/common/configuration'; @@ -51,7 +51,7 @@ export class ReferencesController implements editorCommon.IEditorContribution { public constructor( editor: ICodeEditor, - @IKeybindingService keybindingService: IKeybindingService, + @IContextKeyService contextKeyService: IContextKeyService, @IEditorService private _editorService: IEditorService, @ITelemetryService private _telemetryService: ITelemetryService, @IMessageService private _messageService: IMessageService, @@ -62,7 +62,7 @@ export class ReferencesController implements editorCommon.IEditorContribution { @optional(IPeekViewService) private _peekViewService: IPeekViewService ) { this._editor = editor; - this._referenceSearchVisible = ctxReferenceSearchVisible.bindTo(keybindingService); + this._referenceSearchVisible = ctxReferenceSearchVisible.bindTo(contextKeyService); } public getId(): string { diff --git a/src/vs/editor/contrib/rename/browser/rename.ts b/src/vs/editor/contrib/rename/browser/rename.ts index eeed73b5e35..59f19d24f3d 100644 --- a/src/vs/editor/contrib/rename/browser/rename.ts +++ b/src/vs/editor/contrib/rename/browser/rename.ts @@ -12,7 +12,7 @@ import Severity from 'vs/base/common/severity'; import {TPromise} from 'vs/base/common/winjs.base'; import {IEditorService} from 'vs/platform/editor/common/editor'; import {IEventService} from 'vs/platform/event/common/event'; -import {KbCtxKey, IKeybindingContextKey, IKeybindingService, KbExpr} from 'vs/platform/contextkey/common/contextkey'; +import {KbCtxKey, IKeybindingContextKey, IContextKeyService, KbExpr} from 'vs/platform/contextkey/common/contextkey'; import {IMessageService} from 'vs/platform/message/common/message'; import {IProgressService} from 'vs/platform/progress/common/progress'; import {editorAction, ServicesAccessor, EditorAction, EditorCommand, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions'; @@ -44,10 +44,10 @@ class RenameController implements IEditorContribution { @IEventService private _eventService: IEventService, @IEditorService private _editorService: IEditorService, @IProgressService private _progressService: IProgressService, - @IKeybindingService keybindingService: IKeybindingService + @IContextKeyService contextKeyService: IContextKeyService ) { this._renameInputField = new RenameInputField(editor); - this._renameInputVisible = CONTEXT_RENAME_INPUT_VISIBLE.bindTo(keybindingService); + this._renameInputVisible = CONTEXT_RENAME_INPUT_VISIBLE.bindTo(contextKeyService); } public dispose(): void { diff --git a/src/vs/editor/contrib/selectionClipboard/electron-browser/selectionClipboard.ts b/src/vs/editor/contrib/selectionClipboard/electron-browser/selectionClipboard.ts index a85578f0ea7..69b7d6f156c 100644 --- a/src/vs/editor/contrib/selectionClipboard/electron-browser/selectionClipboard.ts +++ b/src/vs/editor/contrib/selectionClipboard/electron-browser/selectionClipboard.ts @@ -11,7 +11,7 @@ import {ICodeEditor, IEditorMouseEvent} from 'vs/editor/browser/editorBrowser'; import {Disposable} from 'vs/base/common/lifecycle'; import {EndOfLinePreference, IEditorContribution, ICursorSelectionChangedEvent, IConfigurationChangedEvent} from 'vs/editor/common/editorCommon'; import {EditorBrowserRegistry} from 'vs/editor/browser/editorBrowserExtensions'; -import {IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {RunOnceScheduler} from 'vs/base/common/async'; import {Range} from 'vs/editor/common/core/range'; @@ -19,7 +19,7 @@ class SelectionClipboard extends Disposable implements IEditorContribution { private static ID = 'editor.contrib.selectionClipboard'; - constructor(editor:ICodeEditor, @IKeybindingService keybindingService:IKeybindingService) { + constructor(editor:ICodeEditor, @IContextKeyService contextKeyService:IContextKeyService) { super(); if (platform.isLinux) { diff --git a/src/vs/editor/contrib/snippet/common/snippet.ts b/src/vs/editor/contrib/snippet/common/snippet.ts index b70d7360137..ca7fd4f023c 100644 --- a/src/vs/editor/contrib/snippet/common/snippet.ts +++ b/src/vs/editor/contrib/snippet/common/snippet.ts @@ -8,7 +8,7 @@ import * as collections from 'vs/base/common/collections'; import {KeyCode, KeyMod} from 'vs/base/common/keyCodes'; import * as strings from 'vs/base/common/strings'; -import {KbCtxKey, IKeybindingContextKey, IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {KbCtxKey, IKeybindingContextKey, IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {EditOperation} from 'vs/editor/common/core/editOperation'; import {Range} from 'vs/editor/common/core/range'; import {Selection} from 'vs/editor/common/core/selection'; @@ -745,10 +745,10 @@ class SnippetController implements ISnippetController { private _currentController: InsertSnippetController; private _inSnippetMode: IKeybindingContextKey; - constructor(editor: editorCommon.ICommonCodeEditor, @IKeybindingService keybindingService: IKeybindingService) { + constructor(editor: editorCommon.ICommonCodeEditor, @IContextKeyService contextKeyService: IContextKeyService) { this._editor = editor; this._currentController = null; - this._inSnippetMode = CONTEXT_SNIPPET_MODE.bindTo(keybindingService); + this._inSnippetMode = CONTEXT_SNIPPET_MODE.bindTo(contextKeyService); } public dispose(): void { diff --git a/src/vs/editor/contrib/suggest/browser/suggestWidget.ts b/src/vs/editor/contrib/suggest/browser/suggestWidget.ts index 3def13ef0fb..9b4ec0b526f 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestWidget.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestWidget.ts @@ -18,7 +18,7 @@ import { List } from 'vs/base/browser/ui/list/listWidget'; import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IKeybindingService2 } from 'vs/platform/keybinding/common/keybinding'; -import { IKeybindingContextKey, IKeybindingService } from 'vs/platform/contextkey/common/contextkey'; +import { IKeybindingContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IConfigurationChangedEvent } from 'vs/editor/common/editorCommon'; import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser'; import { Context as SuggestContext } from '../common/suggest'; @@ -331,7 +331,7 @@ export class SuggestWidget implements IContentWidget, IDisposable { private editor: ICodeEditor, private model: SuggestModel, @ITelemetryService private telemetryService: ITelemetryService, - @IKeybindingService keybindingService: IKeybindingService, + @IContextKeyService contextKeyService: IContextKeyService, @IInstantiationService instantiationService: IInstantiationService ) { this.isAuto = false; @@ -367,9 +367,9 @@ export class SuggestWidget implements IContentWidget, IDisposable { this.model.onDidCancel(e => this.onDidCancel(e)) ]; - this.suggestWidgetVisible = SuggestContext.Visible.bindTo(keybindingService); - this.suggestWidgetMultipleSuggestions = SuggestContext.MultipleSuggestions.bindTo(keybindingService); - this.suggestionSupportsAutoAccept = SuggestContext.AcceptOnKey.bindTo(keybindingService); + this.suggestWidgetVisible = SuggestContext.Visible.bindTo(contextKeyService); + this.suggestWidgetMultipleSuggestions = SuggestContext.MultipleSuggestions.bindTo(contextKeyService); + this.suggestionSupportsAutoAccept = SuggestContext.AcceptOnKey.bindTo(contextKeyService); this.editor.addContentWidget(this); this.setState(State.Hidden); diff --git a/src/vs/editor/contrib/suggest/browser/tabCompletion.ts b/src/vs/editor/contrib/suggest/browser/tabCompletion.ts index ce67ab28aa2..f9b137057ad 100644 --- a/src/vs/editor/contrib/suggest/browser/tabCompletion.ts +++ b/src/vs/editor/contrib/suggest/browser/tabCompletion.ts @@ -6,7 +6,7 @@ 'use strict'; import {KeyCode} from 'vs/base/common/keyCodes'; -import {KbCtxKey, IKeybindingService, KbExpr} from 'vs/platform/contextkey/common/contextkey'; +import {KbCtxKey, IContextKeyService, KbExpr} from 'vs/platform/contextkey/common/contextkey'; import {KeybindingsRegistry} from 'vs/platform/keybinding/common/keybindingsRegistry'; import {ISnippetsRegistry, Extensions, getNonWhitespacePrefix, ISnippet} from 'vs/editor/common/modes/snippetsRegistry'; import {Registry} from 'vs/platform/platform'; @@ -34,10 +34,10 @@ class TabCompletionController implements editorCommon.IEditorContribution { constructor( editor: editorCommon.ICommonCodeEditor, - @IKeybindingService keybindingService: IKeybindingService + @IContextKeyService contextKeyService: IContextKeyService ) { this._snippetController = getSnippetController(editor); - const hasSnippets = TabCompletionController.ContextKey.bindTo(keybindingService); + const hasSnippets = TabCompletionController.ContextKey.bindTo(contextKeyService); this._cursorChangeSubscription = editor.onDidChangeCursorSelection(e => { this._currentSnippets.length = 0; diff --git a/src/vs/editor/test/common/mocks/mockCodeEditor.ts b/src/vs/editor/test/common/mocks/mockCodeEditor.ts index 98ed7cb77af..49ab8a6343a 100644 --- a/src/vs/editor/test/common/mocks/mockCodeEditor.ts +++ b/src/vs/editor/test/common/mocks/mockCodeEditor.ts @@ -9,7 +9,7 @@ import {ICodeEditorService} from 'vs/editor/common/services/codeEditorService'; import {ServiceCollection} from 'vs/platform/instantiation/common/serviceCollection'; import {InstantiationService} from 'vs/platform/instantiation/common/instantiationService'; import {ICommandService, NullCommandService} from 'vs/platform/commands/common/commands'; -import {IKeybindingService, IKeybindingScopeLocation} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService, IKeybindingScopeLocation} from 'vs/platform/contextkey/common/contextkey'; import {MockKeybindingService} from 'vs/platform/keybinding/test/common/mockKeybindingService'; import {ITelemetryService, NullTelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {CommonCodeEditor} from 'vs/editor/common/commonCodeEditor'; @@ -75,24 +75,24 @@ export class MockScopeLocation implements IKeybindingScopeLocation { export function withMockCodeEditor(text:string[], options:editorCommon.ICodeEditorWidgetCreationOptions, callback:(editor:MockCodeEditor, cursor:Cursor)=>void): void { let codeEditorService = new MockCodeEditorService(); - let keybindingService = new MockKeybindingService(); + let contextKeyService = new MockKeybindingService(); let telemetryService = NullTelemetryService; let commandService = NullCommandService; let services = new ServiceCollection(); services.set(ICodeEditorService, codeEditorService); - services.set(IKeybindingService, keybindingService); + services.set(IContextKeyService, contextKeyService); services.set(ITelemetryService, telemetryService); services.set(ICommandService, commandService); let instantiationService = new InstantiationService(services); let model = Model.createFromString(text.join('\n')); - let editor = new MockCodeEditor(new MockScopeLocation(), options, instantiationService, codeEditorService, commandService, keybindingService, telemetryService); + let editor = new MockCodeEditor(new MockScopeLocation(), options, instantiationService, codeEditorService, commandService, contextKeyService, telemetryService); editor.setModel(model); callback(editor, editor.getCursor()); editor.dispose(); model.dispose(); - keybindingService.dispose(); + contextKeyService.dispose(); } diff --git a/src/vs/platform/actions/common/actions.ts b/src/vs/platform/actions/common/actions.ts index f0adc9b57ee..9868febb045 100644 --- a/src/vs/platform/actions/common/actions.ts +++ b/src/vs/platform/actions/common/actions.ts @@ -10,7 +10,7 @@ import WinJS = require('vs/base/common/winjs.base'); import Descriptors = require('vs/platform/instantiation/common/descriptors'); import Instantiation = require('vs/platform/instantiation/common/instantiation'); import {IKeybindings} from 'vs/platform/keybinding/common/keybinding'; -import {KbExpr, IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {KbExpr, IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {ICommandService} from 'vs/platform/commands/common/commands'; import {IDisposable} from 'vs/base/common/lifecycle'; import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; @@ -48,7 +48,7 @@ export interface IMenuService { _serviceBrand: any; - createMenu(id: MenuId, scopedKeybindingService: IKeybindingService): IMenu; + createMenu(id: MenuId, scopedKeybindingService: IContextKeyService): IMenu; getCommandActions(): ICommandAction[]; } diff --git a/src/vs/platform/actions/common/menuService.ts b/src/vs/platform/actions/common/menuService.ts index f59123b4490..fac85f3e42d 100644 --- a/src/vs/platform/actions/common/menuService.ts +++ b/src/vs/platform/actions/common/menuService.ts @@ -9,7 +9,7 @@ import Event, {Emitter} from 'vs/base/common/event'; import {IDisposable, dispose} from 'vs/base/common/lifecycle'; import {IAction} from 'vs/base/common/actions'; import {values} from 'vs/base/common/collections'; -import {KbExpr, IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {KbExpr, IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {MenuId, MenuRegistry, ICommandAction, MenuItemAction, IMenu, IMenuItem, IMenuService} from 'vs/platform/actions/common/actions'; import {IExtensionService} from 'vs/platform/extensions/common/extensions'; import {ICommandService} from 'vs/platform/commands/common/commands'; @@ -26,8 +26,8 @@ export class MenuService implements IMenuService { // } - createMenu(id: MenuId, keybindingService: IKeybindingService): IMenu { - return new Menu(id, this._commandService, keybindingService, this._extensionService); + createMenu(id: MenuId, contextKeyService: IContextKeyService): IMenu { + return new Menu(id, this._commandService, contextKeyService, this._extensionService); } getCommandActions(): ICommandAction[] { @@ -46,7 +46,7 @@ class Menu implements IMenu { constructor( id: MenuId, @ICommandService private _commandService: ICommandService, - @IKeybindingService private _keybindingService: IKeybindingService, + @IContextKeyService private _contextKeyService: IContextKeyService, @IExtensionService private _extensionService: IExtensionService ) { this._extensionService.onReady().then(_ => { @@ -71,7 +71,7 @@ class Menu implements IMenu { } // subscribe to context changes - this._disposables.push(this._keybindingService.onDidChangeContext(keys => { + this._disposables.push(this._contextKeyService.onDidChangeContext(keys => { for (let k of keys) { if (keysFilter[k]) { this._onDidChange.fire(); @@ -99,8 +99,8 @@ class Menu implements IMenu { const [id, actions] = group; const activeActions: MenuItemAction[] = []; for (let action of actions) { - if (this._keybindingService.contextMatchesRules(action.item.when)) { - action.resource = ResourceContextKey.Resource.getValue(this._keybindingService); + if (this._contextKeyService.contextMatchesRules(action.item.when)) { + action.resource = ResourceContextKey.Resource.getValue(this._contextKeyService); activeActions.push(action); } } diff --git a/src/vs/platform/actions/common/resourceContextKey.ts b/src/vs/platform/actions/common/resourceContextKey.ts index 0b5c5243729..2a7d7ade8c7 100644 --- a/src/vs/platform/actions/common/resourceContextKey.ts +++ b/src/vs/platform/actions/common/resourceContextKey.ts @@ -5,7 +5,7 @@ 'use strict'; import URI from 'vs/base/common/uri'; -import {KbCtxKey, IKeybindingService, IKeybindingContextKey} from 'vs/platform/contextkey/common/contextkey'; +import {KbCtxKey, IContextKeyService, IKeybindingContextKey} from 'vs/platform/contextkey/common/contextkey'; import {IModeService} from 'vs/editor/common/services/modeService'; export class ResourceContextKey implements IKeybindingContextKey { @@ -20,12 +20,12 @@ export class ResourceContextKey implements IKeybindingContextKey { private _langIdKey: IKeybindingContextKey; constructor( - @IKeybindingService keybindingService: IKeybindingService, + @IContextKeyService contextKeyService: IContextKeyService, @IModeService private _modeService: IModeService ) { - this._schemeKey = ResourceContextKey.Scheme.bindTo(keybindingService); - this._langIdKey = ResourceContextKey.LangId.bindTo(keybindingService); - this._resourceKey = ResourceContextKey.Resource.bindTo(keybindingService); + this._schemeKey = ResourceContextKey.Scheme.bindTo(contextKeyService); + this._langIdKey = ResourceContextKey.LangId.bindTo(contextKeyService); + this._resourceKey = ResourceContextKey.Resource.bindTo(contextKeyService); } set(value: URI) { diff --git a/src/vs/platform/actions/test/common/menuService.test.ts b/src/vs/platform/actions/test/common/menuService.test.ts index 6e6d4379179..6e1d0d59bbc 100644 --- a/src/vs/platform/actions/test/common/menuService.test.ts +++ b/src/vs/platform/actions/test/common/menuService.test.ts @@ -26,7 +26,7 @@ const extensionService = new class extends AbstractExtensionService extends KbDefinedExpression { this._defaultValue = defaultValue; } - public bindTo(target:IKeybindingService): IKeybindingContextKey { + public bindTo(target:IContextKeyService): IKeybindingContextKey { return target.createKey(this.key, this._defaultValue); } - public getValue(target:IKeybindingService): T { + public getValue(target:IContextKeyService): T { return target.getContextValue(this.key); } @@ -443,9 +443,9 @@ export interface IKeybindingContext { fillInContext(bucket: any): void; } -export let IKeybindingService = createDecorator('keybindingService'); +export let IContextKeyService = createDecorator('contextKeyService'); -export interface IKeybindingService { +export interface IContextKeyService { _serviceBrand: any; dispose(): void; @@ -454,7 +454,7 @@ export interface IKeybindingService { contextMatchesRules(rules: KbExpr): boolean; getContextValue(key: string): T; - createScoped(domNode: IKeybindingScopeLocation): IKeybindingService; + createScoped(domNode: IKeybindingScopeLocation): IContextKeyService; getContext(contextId: number): IKeybindingContext; } diff --git a/src/vs/platform/keybinding/browser/keybindingServiceImpl.ts b/src/vs/platform/keybinding/browser/keybindingServiceImpl.ts index 9eadc4d2d70..8ba54087091 100644 --- a/src/vs/platform/keybinding/browser/keybindingServiceImpl.ts +++ b/src/vs/platform/keybinding/browser/keybindingServiceImpl.ts @@ -16,7 +16,7 @@ import {IKeyboardEvent, StandardKeyboardEvent} from 'vs/base/browser/keyboardEve import {ICommandService, CommandsRegistry, ICommandHandler, ICommandHandlerDescription} from 'vs/platform/commands/common/commands'; import {KeybindingResolver} from 'vs/platform/keybinding/common/keybindingResolver'; import {IKeybindingItem, IKeybindingService2} from 'vs/platform/keybinding/common/keybinding'; -import {IKeybindingService, KEYBINDING_CONTEXT_ATTR} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService, KEYBINDING_CONTEXT_ATTR} from 'vs/platform/contextkey/common/contextkey'; import {KeybindingsRegistry} from 'vs/platform/keybinding/common/keybindingsRegistry'; import {IStatusbarService} from 'vs/platform/statusbar/common/statusbar'; import {IMessageService} from 'vs/platform/message/common/message'; @@ -30,18 +30,18 @@ export abstract class KeybindingService2 implements IKeybindingService2 { private _currentChord: number; private _currentChordStatusMessage: IDisposable; - private _keybindingService: IKeybindingService; + private _contextKeyService: IContextKeyService; private _commandService: ICommandService; private _statusService: IStatusbarService; private _messageService: IMessageService; constructor( - keybindingService: IKeybindingService, + contextKeyService: IContextKeyService, commandService: ICommandService, messageService: IMessageService, statusService?: IStatusbarService ) { - this._keybindingService = keybindingService; + this._contextKeyService = contextKeyService; this._commandService = commandService; this._statusService = statusService; this._messageService = messageService; @@ -142,7 +142,7 @@ export abstract class KeybindingService2 implements IKeybindingService2 { } let contextValue = Object.create(null); - this._keybindingService.getContext(this._findContextAttr(e.target)).fillInContext(contextValue); + this._contextKeyService.getContext(this._findContextAttr(e.target)).fillInContext(contextValue); // console.log(JSON.stringify(contextValue, null, '\t')); let resolveResult = this._getResolver().resolve(contextValue, this._currentChord, e.asKeybinding()); diff --git a/src/vs/platform/keybinding/test/common/mockKeybindingService.ts b/src/vs/platform/keybinding/test/common/mockKeybindingService.ts index 7ee666664ff..a7ab660c674 100644 --- a/src/vs/platform/keybinding/test/common/mockKeybindingService.ts +++ b/src/vs/platform/keybinding/test/common/mockKeybindingService.ts @@ -8,7 +8,7 @@ import {IHTMLContentElement} from 'vs/base/common/htmlContent'; import {Keybinding} from 'vs/base/common/keyCodes'; import Event from 'vs/base/common/event'; import {IKeybindingService2} from 'vs/platform/keybinding/common/keybinding'; -import {IKeybindingContextKey, IKeybindingService, IKeybindingContext, KbExpr} from 'vs/platform/contextkey/common/contextkey'; +import {IKeybindingContextKey, IContextKeyService, IKeybindingContext, KbExpr} from 'vs/platform/contextkey/common/contextkey'; class MockKeybindingContextKey implements IKeybindingContextKey { private _key: string; @@ -34,7 +34,7 @@ class MockKeybindingContextKey implements IKeybindingContextKey { } } -export class MockKeybindingService implements IKeybindingService { +export class MockKeybindingService implements IContextKeyService { public _serviceBrand: any; public dispose(): void { } @@ -54,7 +54,7 @@ export class MockKeybindingService implements IKeybindingService { public getContext(contextId: number): IKeybindingContext { return null; } - public createScoped(domNode: HTMLElement): IKeybindingService { + public createScoped(domNode: HTMLElement): IContextKeyService { return this; } } diff --git a/src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts b/src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts index db4eefe8d7a..e971d1377a0 100644 --- a/src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts +++ b/src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts @@ -30,7 +30,7 @@ import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {IConfigurationService} from 'vs/platform/configuration/common/configuration'; import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; import {ServiceCollection} from 'vs/platform/instantiation/common/serviceCollection'; -import {IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {IExtensionService} from 'vs/platform/extensions/common/extensions'; import {IDisposable, dispose} from 'vs/base/common/lifecycle'; import {TabsTitleControl} from 'vs/workbench/browser/parts/editor/tabsTitleControl'; @@ -136,7 +136,7 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti @IContextMenuService private contextMenuService: IContextMenuService, @IEventService private eventService: IEventService, @IConfigurationService private configurationService: IConfigurationService, - @IKeybindingService private keybindingService: IKeybindingService, + @IContextKeyService private contextKeyService: IContextKeyService, @IExtensionService private extensionService: IExtensionService, @IInstantiationService private instantiationService: IInstantiationService ) { @@ -774,7 +774,7 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti // InstantiationServices const instantiationService = this.instantiationService.createChild(new ServiceCollection( - [IKeybindingService, this.keybindingService.createScoped(container.getHTMLElement())] + [IContextKeyService, this.contextKeyService.createScoped(container.getHTMLElement())] )); container.setProperty(SideBySideEditorControl.INSTANTIATION_SERVICE_KEY, instantiationService); // associate with container diff --git a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts index 728e4e48737..117ad601224 100644 --- a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts @@ -25,7 +25,7 @@ import {IMessageService} from 'vs/platform/message/common/message'; import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; import {IKeybindingService2} from 'vs/platform/keybinding/common/keybinding'; -import {IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {IMenuService} from 'vs/platform/actions/common/actions'; import {TitleControl} from 'vs/workbench/browser/parts/editor/titleControl'; import {IQuickOpenService} from 'vs/workbench/services/quickopen/common/quickOpenService'; @@ -48,14 +48,14 @@ export class TabsTitleControl extends TitleControl { @IWorkbenchEditorService editorService: IWorkbenchEditorService, @IEditorGroupService editorGroupService: IEditorGroupService, @IUntitledEditorService private untitledEditorService: IUntitledEditorService, - @IKeybindingService keybindingService: IKeybindingService, + @IContextKeyService contextKeyService: IContextKeyService, @IKeybindingService2 keybindingService2: IKeybindingService2, @ITelemetryService telemetryService: ITelemetryService, @IMessageService messageService: IMessageService, @IMenuService menuService: IMenuService, @IQuickOpenService quickOpenService: IQuickOpenService ) { - super(contextMenuService, instantiationService, configurationService, editorService, editorGroupService, keybindingService, keybindingService2, telemetryService, messageService, menuService, quickOpenService); + super(contextMenuService, instantiationService, configurationService, editorService, editorGroupService, contextKeyService, keybindingService2, telemetryService, messageService, menuService, quickOpenService); this.tabDisposeables = []; } diff --git a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts index 52dff74994c..182f49d903c 100644 --- a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts @@ -35,7 +35,7 @@ import {ServiceCollection} from 'vs/platform/instantiation/common/serviceCollect import {IMessageService} from 'vs/platform/message/common/message'; import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService'; import {IModeService} from 'vs/editor/common/services/modeService'; -import {KbCtxKey, IKeybindingService, IKeybindingContextKey} from 'vs/platform/contextkey/common/contextkey'; +import {KbCtxKey, IContextKeyService, IKeybindingContextKey} from 'vs/platform/contextkey/common/contextkey'; import {IThemeService} from 'vs/workbench/services/themes/common/themeService'; export const TextCompareEditorVisible = new KbCtxKey('textCompareEditorVisible', false); @@ -63,12 +63,12 @@ export class TextDiffEditor extends BaseTextEditor { @IEventService eventService: IEventService, @IWorkbenchEditorService editorService: IWorkbenchEditorService, @IModeService modeService: IModeService, - @IKeybindingService keybindingService: IKeybindingService, + @IContextKeyService contextKeyService: IContextKeyService, @IThemeService themeService: IThemeService ) { super(TextDiffEditor.ID, telemetryService, instantiationService, contextService, storageService, messageService, configurationService, eventService, editorService, modeService, themeService); - this.textDiffEditorVisible = TextCompareEditorVisible.bindTo(keybindingService); + this.textDiffEditorVisible = TextCompareEditorVisible.bindTo(contextKeyService); } public getTitle(): string { diff --git a/src/vs/workbench/browser/parts/editor/titleControl.ts b/src/vs/workbench/browser/parts/editor/titleControl.ts index b3aac60adaa..a45a4a4afc1 100644 --- a/src/vs/workbench/browser/parts/editor/titleControl.ts +++ b/src/vs/workbench/browser/parts/editor/titleControl.ts @@ -30,7 +30,7 @@ import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; import {IQuickOpenService} from 'vs/workbench/services/quickopen/common/quickOpenService'; import {IKeybindingService2} from 'vs/platform/keybinding/common/keybinding'; -import {IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {CloseEditorsInGroupAction, SplitEditorAction, CloseEditorAction, KeepEditorAction, CloseOtherEditorsInGroupAction, CloseRightEditorsInGroupAction, ShowEditorsInGroupAction} from 'vs/workbench/browser/parts/editor/editorActions'; import {IDisposable, dispose} from 'vs/base/common/lifecycle'; import {createActionItem, fillInActions} from 'vs/platform/actions/browser/menuItemActionItem'; @@ -95,7 +95,7 @@ export abstract class TitleControl implements ITitleAreaControl { @IConfigurationService protected configurationService: IConfigurationService, @IWorkbenchEditorService protected editorService: IWorkbenchEditorService, @IEditorGroupService protected editorGroupService: IEditorGroupService, - @IKeybindingService protected keybindingService: IKeybindingService, + @IContextKeyService protected contextKeyService: IContextKeyService, @IKeybindingService2 protected keybindingService2: IKeybindingService2, @ITelemetryService protected telemetryService: ITelemetryService, @IMessageService protected messageService: IMessageService, @@ -113,7 +113,7 @@ export abstract class TitleControl implements ITitleAreaControl { this.resourceContext = instantiationService.createInstance(ResourceContextKey); - this.contributedTitleBarMenu = this.menuService.createMenu(MenuId.EditorTitle, this.keybindingService); + this.contributedTitleBarMenu = this.menuService.createMenu(MenuId.EditorTitle, this.contextKeyService); this.toDispose.push(this.contributedTitleBarMenu); this.toDispose.push(this.contributedTitleBarMenu.onDidChange(e => this.update())); diff --git a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts index ec68c5f0586..eece098fd98 100644 --- a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts +++ b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts @@ -37,7 +37,7 @@ import {IInstantiationService} from 'vs/platform/instantiation/common/instantiat import {IMessageService, Severity} from 'vs/platform/message/common/message'; import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {IWorkspaceContextService} from 'vs/workbench/services/workspace/common/contextService'; -import {IKeybindingService, KbCtxKey, IKeybindingContextKey} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService, KbCtxKey, IKeybindingContextKey} from 'vs/platform/contextkey/common/contextkey'; import {IHistoryService} from 'vs/workbench/services/history/common/history'; const HELP_PREFIX = '?'; @@ -88,7 +88,7 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe @IMessageService private messageService: IMessageService, @ITelemetryService private telemetryService: ITelemetryService, @IWorkspaceContextService private contextService: IWorkspaceContextService, - @IKeybindingService keybindingService: IKeybindingService, + @IContextKeyService contextKeyService: IContextKeyService, @IHistoryService private historyService: IHistoryService, @IInstantiationService private instantiationService: IInstantiationService ) { @@ -98,7 +98,7 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe this.promisesToCompleteOnHide = []; - this.inQuickOpenMode = QUICK_OPEN_MODE.bindTo(keybindingService); + this.inQuickOpenMode = QUICK_OPEN_MODE.bindTo(contextKeyService); this._onShow = new Emitter(); this._onHide = new Emitter(); diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index 0bb764f7b00..072294dbb90 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -44,10 +44,11 @@ import {Position, Parts, IPartService} from 'vs/workbench/services/part/common/p import {IWorkspaceContextService as IWorkbenchWorkspaceContextService} from 'vs/workbench/services/workspace/common/contextService'; import {IStorageService, StorageScope} from 'vs/platform/storage/common/storage'; import {ContextMenuService} from 'vs/workbench/services/contextview/electron-browser/contextmenuService'; -import {WorkbenchKeybindingService, WorkbenchKeybindingService2} from 'vs/workbench/services/keybinding/electron-browser/keybindingService'; +import {WorkbenchKeybindingService2} from 'vs/workbench/services/keybinding/electron-browser/keybindingService'; +import {KeybindingService} from 'vs/platform/contextkey/browser/contextKeyService'; import {IWorkspace, IConfiguration} from 'vs/platform/workspace/common/workspace'; import {IKeybindingService2} from 'vs/platform/keybinding/common/keybinding'; -import {KbExpr, KbCtxKey, IKeybindingService, IKeybindingContextKey} from 'vs/platform/contextkey/common/contextkey'; +import {KbExpr, KbCtxKey, IContextKeyService, IKeybindingContextKey} from 'vs/platform/contextkey/common/contextkey'; import {IActivityService} from 'vs/workbench/services/activity/common/activityService'; import {IViewletService} from 'vs/workbench/services/viewlet/common/viewletService'; import {IPanelService} from 'vs/workbench/services/panel/common/panelService'; @@ -104,7 +105,7 @@ export class Workbench implements IPartService { private workbenchCreated: boolean; private workbenchShutdown: boolean; private editorService: WorkbenchEditorService; - private keybindingService: IKeybindingService; + private contextKeyService: IContextKeyService; private keybindingService2: IKeybindingService2; private activitybarPart: ActivitybarPart; private sidebarPart: SidebarPart; @@ -204,8 +205,8 @@ export class Workbench implements IPartService { } // Contexts - this.messagesVisibleContext = MessagesVisibleContext.bindTo(this.keybindingService); - this.editorsVisibleContext = EditorsVisibleContext.bindTo(this.keybindingService); + this.messagesVisibleContext = MessagesVisibleContext.bindTo(this.contextKeyService); + this.editorsVisibleContext = EditorsVisibleContext.bindTo(this.contextKeyService); // Register Listeners this.registerListeners(); @@ -352,8 +353,8 @@ export class Workbench implements IPartService { serviceCollection.set(IStatusbarService, this.statusbarPart); // Keybindings - this.keybindingService = this.instantiationService.createInstance(WorkbenchKeybindingService); - serviceCollection.set(IKeybindingService, this.keybindingService); + this.contextKeyService = this.instantiationService.createInstance(KeybindingService); + serviceCollection.set(IContextKeyService, this.contextKeyService); this.keybindingService2 = this.instantiationService.createInstance(WorkbenchKeybindingService2, window); serviceCollection.set(IKeybindingService2, this.keybindingService2); diff --git a/src/vs/workbench/parts/debug/browser/breakpointWidget.ts b/src/vs/workbench/parts/debug/browser/breakpointWidget.ts index 9ad227c5f04..f66026b796c 100644 --- a/src/vs/workbench/parts/debug/browser/breakpointWidget.ts +++ b/src/vs/workbench/parts/debug/browser/breakpointWidget.ts @@ -18,7 +18,7 @@ import editorbrowser = require('vs/editor/browser/editorBrowser'); import {ZoneWidget} from 'vs/editor/contrib/zoneWidget/browser/zoneWidget'; import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; import {IContextViewService} from 'vs/platform/contextview/browser/contextView'; -import {KbCtxKey, IKeybindingService, IKeybindingContextKey} from 'vs/platform/contextkey/common/contextkey'; +import {KbCtxKey, IContextKeyService, IKeybindingContextKey} from 'vs/platform/contextkey/common/contextkey'; import debug = require('vs/workbench/parts/debug/common/debug'); import {IKeyboardEvent} from 'vs/base/browser/keyboardEvent'; @@ -37,13 +37,13 @@ export class BreakpointWidget extends ZoneWidget { constructor(editor: editorbrowser.ICodeEditor, private lineNumber: number, @IContextViewService private contextViewService: IContextViewService, @debug.IDebugService private debugService: debug.IDebugService, - @IKeybindingService keybindingService: IKeybindingService + @IContextKeyService contextKeyService: IContextKeyService ) { super(editor, { showFrame: true, showArrow: false }); this.toDispose = []; this.create(); - this.breakpointWidgetVisible = CONTEXT_BREAKPOINT_WIDGET_VISIBLE.bindTo(keybindingService); + this.breakpointWidgetVisible = CONTEXT_BREAKPOINT_WIDGET_VISIBLE.bindTo(contextKeyService); this.breakpointWidgetVisible.set(true); BreakpointWidget.INSTANCE = this; this.toDispose.push(editor.onDidChangeModel(() => this.dispose())); diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index c5f963c1e59..56425caaa02 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -17,7 +17,7 @@ import severity from 'vs/base/common/severity'; import {TPromise} from 'vs/base/common/winjs.base'; import aria = require('vs/base/browser/ui/aria/aria'); import editorbrowser = require('vs/editor/browser/editorBrowser'); -import {IKeybindingService, IKeybindingContextKey} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService, IKeybindingContextKey} from 'vs/platform/contextkey/common/contextkey'; import {IMarkerService} from 'vs/platform/markers/common/markers'; import {ILifecycleService} from 'vs/platform/lifecycle/common/lifecycle'; import {IExtensionService} from 'vs/platform/extensions/common/extensions'; @@ -88,7 +88,7 @@ export class DebugService implements debug.IDebugService { @IWindowService private windowService: IWindowService, @ITelemetryService private telemetryService: ITelemetryService, @IWorkspaceContextService private contextService: IWorkspaceContextService, - @IKeybindingService keybindingService: IKeybindingService, + @IContextKeyService contextKeyService: IContextKeyService, @IEditorGroupService private editorGroupService: IEditorGroupService, @IEventService eventService: IEventService, @ILifecycleService private lifecycleService: ILifecycleService, @@ -109,7 +109,7 @@ export class DebugService implements debug.IDebugService { this._state = debug.State.Disabled; } this.configurationManager = this.instantiationService.createInstance(ConfigurationManager, this.storageService.get(DEBUG_SELECTED_CONFIG_NAME_KEY, StorageScope.WORKSPACE, 'null')); - this.inDebugMode = debug.CONTEXT_IN_DEBUG_MODE.bindTo(keybindingService); + this.inDebugMode = debug.CONTEXT_IN_DEBUG_MODE.bindTo(contextKeyService); this.model = new model.Model(this.loadBreakpoints(), this.storageService.getBoolean(DEBUG_BREAKPOINTS_ACTIVATED_KEY, StorageScope.WORKSPACE, true), this.loadFunctionBreakpoints(), this.loadExceptionBreakpoints(), this.loadWatchExpressions()); diff --git a/src/vs/workbench/parts/files/browser/explorerViewlet.ts b/src/vs/workbench/parts/files/browser/explorerViewlet.ts index 0b93a5237ec..2c6d5bd28d3 100644 --- a/src/vs/workbench/parts/files/browser/explorerViewlet.ts +++ b/src/vs/workbench/parts/files/browser/explorerViewlet.ts @@ -30,7 +30,7 @@ import {EditorInput, EditorOptions} from 'vs/workbench/common/editor'; import {BaseEditor} from 'vs/workbench/browser/parts/editor/baseEditor'; import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService'; import {IEditorGroupService} from 'vs/workbench/services/group/common/groupService'; -import {IKeybindingService, IKeybindingContextKey} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService, IKeybindingContextKey} from 'vs/platform/contextkey/common/contextkey'; export class ExplorerViewlet extends Viewlet { private viewletContainer: Builder; @@ -58,14 +58,14 @@ export class ExplorerViewlet extends Viewlet { @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IConfigurationService private configurationService: IConfigurationService, @IInstantiationService private instantiationService: IInstantiationService, - @IKeybindingService keybindingService: IKeybindingService + @IContextKeyService contextKeyService: IContextKeyService ) { super(VIEWLET_ID, telemetryService); this.views = []; this.viewletState = new FileViewletState(); - this.viewletVisibleContextKey = ExplorerViewletVisible.bindTo(keybindingService); + this.viewletVisibleContextKey = ExplorerViewletVisible.bindTo(contextKeyService); this.viewletSettings = this.getMemento(storageService, Scope.WORKSPACE); this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(e.config)); diff --git a/src/vs/workbench/parts/files/browser/views/explorerViewer.ts b/src/vs/workbench/parts/files/browser/views/explorerViewer.ts index e1dfe1df30a..a8aa4b88025 100644 --- a/src/vs/workbench/parts/files/browser/views/explorerViewer.ts +++ b/src/vs/workbench/parts/files/browser/views/explorerViewer.ts @@ -38,7 +38,7 @@ import {IPartService} from 'vs/workbench/services/part/common/partService'; import {IWorkspaceContextService} from 'vs/workbench/services/workspace/common/contextService'; import {IWorkspace} from 'vs/platform/workspace/common/workspace'; import {IConfigurationService} from 'vs/platform/configuration/common/configuration'; -import {IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {IContextViewService, IContextMenuService} from 'vs/platform/contextview/browser/contextView'; import {IEventService} from 'vs/platform/event/common/event'; import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; @@ -371,11 +371,11 @@ export class FileController extends DefaultController { @ITelemetryService private telemetryService: ITelemetryService, @IWorkspaceContextService private contextService: IWorkspaceContextService, @IMenuService menuService: IMenuService, - @IKeybindingService keybindingService: IKeybindingService + @IContextKeyService contextKeyService: IContextKeyService ) { super({ clickBehavior: ClickBehavior.ON_MOUSE_DOWN }); - this.contributedContextMenu = menuService.createMenu(MenuId.ExplorerContext, keybindingService); + this.contributedContextMenu = menuService.createMenu(MenuId.ExplorerContext, contextKeyService); this.workspace = contextService.getWorkspace(); diff --git a/src/vs/workbench/parts/search/browser/searchViewlet.ts b/src/vs/workbench/parts/search/browser/searchViewlet.ts index 28581e8f10a..3d388c8f4d1 100644 --- a/src/vs/workbench/parts/search/browser/searchViewlet.ts +++ b/src/vs/workbench/parts/search/browser/searchViewlet.ts @@ -46,7 +46,7 @@ import {ISearchService} from 'vs/platform/search/common/search'; import {IProgressService} from 'vs/platform/progress/common/progress'; import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace'; import {IKeybindingService2} from 'vs/platform/keybinding/common/keybinding'; -import {IKeybindingService, IKeybindingContextKey} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService, IKeybindingContextKey} from 'vs/platform/contextkey/common/contextkey'; import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {KeyCode, CommonKeybindings} from 'vs/base/common/keyCodes'; import { PatternInputWidget } from 'vs/workbench/parts/search/browser/patternInputWidget'; @@ -100,14 +100,14 @@ export class SearchViewlet extends Viewlet { @IConfigurationService private configurationService: IConfigurationService, @IWorkspaceContextService private contextService: IWorkspaceContextService, @ISearchService private searchService: ISearchService, - @IKeybindingService private keybindingService: IKeybindingService, + @IContextKeyService private contextKeyService: IContextKeyService, @IKeybindingService2 private keybindingService2: IKeybindingService2, @IReplaceService private replaceService: IReplaceService ) { super(VIEWLET_ID, telemetryService); this.toDispose = []; - this.viewletVisible = SearchViewletVisible.bindTo(keybindingService); + this.viewletVisible = SearchViewletVisible.bindTo(contextKeyService); this.callOnModelChange = []; this.queryBuilder = this.instantiationService.createInstance(QueryBuilder); @@ -269,7 +269,7 @@ export class SearchViewlet extends Viewlet { isRegex: isRegex, isCaseSensitive: isCaseSensitive, isWholeWords: isWholeWords - }, this.keybindingService, this.keybindingService2, this.instantiationService); + }, this.contextKeyService, this.keybindingService2, this.instantiationService); if (this.storageService.getBoolean(SearchViewlet.SHOW_REPLACE_STORAGE_KEY, StorageScope.WORKSPACE, true)) { this.searchWidget.toggleReplace(true); diff --git a/src/vs/workbench/parts/search/browser/searchWidget.ts b/src/vs/workbench/parts/search/browser/searchWidget.ts index 4906512ec84..d2562c0e9c5 100644 --- a/src/vs/workbench/parts/search/browser/searchWidget.ts +++ b/src/vs/workbench/parts/search/browser/searchWidget.ts @@ -16,7 +16,7 @@ import { Button } from 'vs/base/browser/ui/button/button'; import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { IKeybindingService2 } from 'vs/platform/keybinding/common/keybinding'; -import { KbExpr, KbCtxKey, IKeybindingService, IKeybindingContextKey } from 'vs/platform/contextkey/common/contextkey'; +import { KbExpr, KbCtxKey, IContextKeyService, IKeybindingContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import Event, { Emitter } from 'vs/base/common/event'; @@ -104,7 +104,7 @@ export class SearchWidget extends Widget { public onReplaceAll: Event = this._onReplaceAll.event; constructor(container: Builder, private contextViewService: IContextViewService, options: ISearchWidgetOptions= Object.create(null), - private keyBindingService: IKeybindingService, private keyBindingService2: IKeybindingService2, private instantiationService: IInstantiationService) { + private keyBindingService: IContextKeyService, private keyBindingService2: IKeybindingService2, private instantiationService: IInstantiationService) { super(); this.replaceActive = SearchWidget.REPLACE_ACTIVE_CONTEXT_KEY.bindTo(this.keyBindingService); this.render(container, options); diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts index 7ec7ee3cf42..45c532ef9ba 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts @@ -14,7 +14,7 @@ import {Builder} from 'vs/base/browser/builder'; import {EndOfLinePreference} from 'vs/editor/common/editorCommon'; import {ICodeEditorService} from 'vs/editor/common/services/codeEditorService'; import {IConfigurationService} from 'vs/platform/configuration/common/configuration'; -import {IKeybindingContextKey, IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {IKeybindingContextKey, IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {IMessageService, Severity} from 'vs/platform/message/common/message'; import {IPanelService} from 'vs/workbench/services/panel/common/panelService'; import {IPartService} from 'vs/workbench/services/part/common/partService'; @@ -40,7 +40,7 @@ export class TerminalService implements ITerminalService { constructor( @ICodeEditorService private codeEditorService: ICodeEditorService, @IConfigurationService private configurationService: IConfigurationService, - @IKeybindingService private keybindingService: IKeybindingService, + @IContextKeyService private contextKeyService: IContextKeyService, @IMessageService private messageService: IMessageService, @IPanelService private panelService: IPanelService, @IPartService private partService: IPartService, @@ -49,7 +49,7 @@ export class TerminalService implements ITerminalService { this._onActiveInstanceChanged = new Emitter(); this._onInstancesChanged = new Emitter(); this._onInstanceTitleChanged = new Emitter(); - this._terminalFocusContextKey = KEYBINDING_CONTEXT_TERMINAL_FOCUS.bindTo(this.keybindingService); + this._terminalFocusContextKey = KEYBINDING_CONTEXT_TERMINAL_FOCUS.bindTo(this.contextKeyService); } public get onActiveInstanceChanged(): Event { diff --git a/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts b/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts index 39eba476048..717321982f1 100644 --- a/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts +++ b/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts @@ -13,16 +13,14 @@ import {IEventService} from 'vs/platform/event/common/event'; import {IExtensionMessageCollector, ExtensionsRegistry} from 'vs/platform/extensions/common/extensionsRegistry'; import {Extensions, IJSONContributionRegistry} from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; import {KeybindingService2} from 'vs/platform/keybinding/browser/keybindingServiceImpl'; -import {KeybindingService} from 'vs/platform/contextkey/browser/contextKeyService'; import {IStatusbarService} from 'vs/platform/statusbar/common/statusbar'; import {IOSupport} from 'vs/platform/keybinding/common/keybindingResolver'; import {ICommandService} from 'vs/platform/commands/common/commands'; import {IKeybindingItem, IUserFriendlyKeybinding} from 'vs/platform/keybinding/common/keybinding'; -import {IKeybindingService} from 'vs/platform/contextkey/common/contextkey'; +import {IContextKeyService} from 'vs/platform/contextkey/common/contextkey'; import {IKeybindingRule, KeybindingsRegistry} from 'vs/platform/keybinding/common/keybindingsRegistry'; import {Registry} from 'vs/platform/platform'; import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; -import {IConfigurationService} from 'vs/platform/configuration/common/configuration'; import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace'; import {EventType, OptionsChangeEvent} from 'vs/workbench/common/events'; import {getNativeLabelProvider, getNativeAriaLabelProvider} from 'vs/workbench/services/keybinding/electron-browser/nativeKeymap'; @@ -124,7 +122,7 @@ export class WorkbenchKeybindingService2 extends KeybindingService2 { constructor( domNode: HTMLElement, - @IKeybindingService keybindingService: IKeybindingService, + @IContextKeyService contextKeyService: IContextKeyService, @ICommandService commandService: ICommandService, @IWorkspaceContextService contextService: IWorkspaceContextService, @IEventService eventService: IEventService, @@ -132,7 +130,7 @@ export class WorkbenchKeybindingService2 extends KeybindingService2 { @IMessageService messageService: IMessageService, @IStatusbarService statusBarService: IStatusbarService ) { - super(keybindingService, commandService, messageService, statusBarService); + super(contextKeyService, commandService, messageService, statusBarService); this.contextService = contextService; this.eventService = eventService; this.telemetryService = telemetryService; @@ -285,14 +283,6 @@ export class WorkbenchKeybindingService2 extends KeybindingService2 { } } -export class WorkbenchKeybindingService extends KeybindingService { - constructor( - @IConfigurationService configurationService: IConfigurationService - ) { - super(configurationService); - } -} - let schemaId = 'vscode://schemas/keybindings'; let schema: IJSONSchema = { 'id': schemaId,