Rename IKeybindingService -> IContextKeyService

This commit is contained in:
Alex Dima 2016-08-12 16:53:59 +02:00
parent 1896431d06
commit e749f18d6f
48 changed files with 206 additions and 215 deletions

View file

@ -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);

View file

@ -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 {

View file

@ -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;
}

View file

@ -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<boolean>;
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 = <HTMLTextAreaElement>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');

View file

@ -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,

View file

@ -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));

View file

@ -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;

View file

@ -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();
}

View file

@ -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;

View file

@ -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<void> {

View file

@ -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()));

View file

@ -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<boolean>;
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';

View file

@ -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)));

View file

@ -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));
}

View file

@ -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 <CommonFindController>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)));

View file

@ -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 {

View file

@ -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 = [];

View file

@ -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);
},() => {

View file

@ -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);
}
}

View file

@ -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 {

View file

@ -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 {

View file

@ -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) {

View file

@ -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<boolean>;
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 {

View file

@ -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);

View file

@ -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;

View file

@ -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();
}

View file

@ -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[];
}

View file

@ -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);
}
}

View file

@ -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<URI> {
@ -20,12 +20,12 @@ export class ResourceContextKey implements IKeybindingContextKey<URI> {
private _langIdKey: IKeybindingContextKey<string>;
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) {

View file

@ -26,7 +26,7 @@ const extensionService = new class extends AbstractExtensionService<ActivatedExt
}
}(true);
const keybindingService = new class extends MockKeybindingService {
const contextKeyService = new class extends MockKeybindingService {
contextMatchesRules() {
return true;
}
@ -75,7 +75,7 @@ suite('MenuService', function () {
group: 'navigation'
}));
const groups = menuService.createMenu(MenuId.ExplorerContext, keybindingService).getActions();
const groups = menuService.createMenu(MenuId.ExplorerContext, contextKeyService).getActions();
assert.equal(groups.length, 5);
const [one, two, three, four, five] = groups;
@ -104,7 +104,7 @@ suite('MenuService', function () {
group: 'Hello'
}));
const groups = menuService.createMenu(MenuId.ExplorerContext, keybindingService).getActions();
const groups = menuService.createMenu(MenuId.ExplorerContext, contextKeyService).getActions();
assert.equal(groups.length, 1);
const [[, actions]] = groups;
@ -141,7 +141,7 @@ suite('MenuService', function () {
order: -1
}));
const groups = menuService.createMenu(MenuId.ExplorerContext, keybindingService).getActions();
const groups = menuService.createMenu(MenuId.ExplorerContext, contextKeyService).getActions();
assert.equal(groups.length, 1);
const [[, actions]] = groups;
@ -175,7 +175,7 @@ suite('MenuService', function () {
order: 1.1
}));
const groups = menuService.createMenu(MenuId.ExplorerContext, keybindingService).getActions();
const groups = menuService.createMenu(MenuId.ExplorerContext, contextKeyService).getActions();
assert.equal(groups.length, 1);
const [[, actions]] = groups;

View file

@ -7,7 +7,7 @@
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
import {CommandsRegistry} from 'vs/platform/commands/common/commands';
import {KeybindingResolver} from 'vs/platform/keybinding/common/keybindingResolver';
import {IKeybindingContextKey, IKeybindingScopeLocation, IKeybindingService, SET_CONTEXT_COMMAND_ID, KEYBINDING_CONTEXT_ATTR, KbExpr} from 'vs/platform/contextkey/common/contextkey';
import {IKeybindingContextKey, IKeybindingScopeLocation, IContextKeyService, SET_CONTEXT_COMMAND_ID, KEYBINDING_CONTEXT_ATTR, KbExpr} from 'vs/platform/contextkey/common/contextkey';
import {IConfigurationService} from 'vs/platform/configuration/common/configuration';
import Event, {Emitter, debounceEvent} from 'vs/base/common/event';
@ -162,7 +162,7 @@ export abstract class AbstractKeybindingService {
return this._onDidChangeContext;
}
public createScoped(domNode: IKeybindingScopeLocation): IKeybindingService {
public createScoped(domNode: IKeybindingScopeLocation): IContextKeyService {
return new ScopedKeybindingService(this, this._onDidChangeContextKey, domNode);
}
@ -198,7 +198,7 @@ export abstract class AbstractKeybindingService {
}
export abstract class KeybindingService extends AbstractKeybindingService implements IKeybindingService {
export class KeybindingService extends AbstractKeybindingService implements IContextKeyService {
private _lastContextId: number;
private _contexts: {
@ -207,7 +207,7 @@ export abstract class KeybindingService extends AbstractKeybindingService implem
private _toDispose: IDisposable[] = [];
constructor(configurationService: IConfigurationService) {
constructor(@IConfigurationService configurationService: IConfigurationService) {
super(0);
this._lastContextId = 0;
this._contexts = Object.create(null);
@ -248,7 +248,7 @@ export abstract class KeybindingService extends AbstractKeybindingService implem
}
CommandsRegistry.registerCommand(SET_CONTEXT_COMMAND_ID, function (accessor, contextKey: any, contextValue: any) {
accessor.get(IKeybindingService).createKey(String(contextKey), contextValue);
accessor.get(IContextKeyService).createKey(String(contextKey), contextValue);
});
class ScopedKeybindingService extends AbstractKeybindingService {

View file

@ -355,11 +355,11 @@ export class KbCtxKey<T> extends KbDefinedExpression {
this._defaultValue = defaultValue;
}
public bindTo(target:IKeybindingService): IKeybindingContextKey<T> {
public bindTo(target:IContextKeyService): IKeybindingContextKey<T> {
return target.createKey(this.key, this._defaultValue);
}
public getValue(target:IKeybindingService): T {
public getValue(target:IContextKeyService): T {
return target.getContextValue<T>(this.key);
}
@ -443,9 +443,9 @@ export interface IKeybindingContext {
fillInContext(bucket: any): void;
}
export let IKeybindingService = createDecorator<IKeybindingService>('keybindingService');
export let IContextKeyService = createDecorator<IContextKeyService>('contextKeyService');
export interface IKeybindingService {
export interface IContextKeyService {
_serviceBrand: any;
dispose(): void;
@ -454,7 +454,7 @@ export interface IKeybindingService {
contextMatchesRules(rules: KbExpr): boolean;
getContextValue<T>(key: string): T;
createScoped(domNode: IKeybindingScopeLocation): IKeybindingService;
createScoped(domNode: IKeybindingScopeLocation): IContextKeyService;
getContext(contextId: number): IKeybindingContext;
}

View file

@ -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());

View file

@ -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<T> implements IKeybindingContextKey<T> {
private _key: string;
@ -34,7 +34,7 @@ class MockKeybindingContextKey<T> implements IKeybindingContextKey<T> {
}
}
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;
}
}

View file

@ -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

View file

@ -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 = [];
}

View file

@ -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<boolean>('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 {

View file

@ -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()));

View file

@ -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<void>();
this._onHide = new Emitter<void>();

View file

@ -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, <any>window);
serviceCollection.set(IKeybindingService2, this.keybindingService2);

View file

@ -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()));

View file

@ -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());

View file

@ -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));

View file

@ -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();

View file

@ -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);

View file

@ -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<void> = 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);

View file

@ -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<string>();
this._onInstancesChanged = new Emitter<string>();
this._onInstanceTitleChanged = new Emitter<string>();
this._terminalFocusContextKey = KEYBINDING_CONTEXT_TERMINAL_FOCUS.bindTo(this.keybindingService);
this._terminalFocusContextKey = KEYBINDING_CONTEXT_TERMINAL_FOCUS.bindTo(this.contextKeyService);
}
public get onActiveInstanceChanged(): Event<string> {

View file

@ -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,