Merge VS Code 1.31.1 (#4283)

This commit is contained in:
Matt Irvine
2019-03-15 13:09:45 -07:00
committed by GitHub
parent 7d31575149
commit 86bac90001
1716 changed files with 53308 additions and 48375 deletions

View File

@@ -93,12 +93,16 @@ export abstract class AbstractKeybindingService extends Disposable implements IK
);
}
public lookupKeybinding(commandId: string): ResolvedKeybinding | null {
public lookupKeybinding(commandId: string): ResolvedKeybinding | undefined {
let result = this._getResolver().lookupPrimaryKeybinding(commandId);
if (!result) {
return null;
return undefined;
}
return result.resolvedKeybinding;
return result.resolvedKeybinding || undefined;
}
public dispatchEvent(e: IKeyboardEvent, target: IContextKeyServiceTarget): boolean {
return this._dispatch(e, target);
}
public softDispatch(e: IKeyboardEvent, target: IContextKeyServiceTarget): IResolveResult | null {
@@ -152,10 +156,20 @@ export abstract class AbstractKeybindingService extends Disposable implements IK
this._currentChord = null;
}
public dispatchByUserSettingsLabel(userSettingsLabel: string, target: IContextKeyServiceTarget): void {
const keybindings = this.resolveUserBinding(userSettingsLabel);
if (keybindings.length >= 1) {
this._doDispatch(keybindings[0], target);
}
}
protected _dispatch(e: IKeyboardEvent, target: IContextKeyServiceTarget): boolean {
return this._doDispatch(this.resolveKeyboardEvent(e), target);
}
private _doDispatch(keybinding: ResolvedKeybinding, target: IContextKeyServiceTarget): boolean {
let shouldPreventDefault = false;
const keybinding = this.resolveKeyboardEvent(e);
if (keybinding.isChord()) {
console.warn('Unexpected keyboard event mapped to a chord');
return false;