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

@@ -27,9 +27,9 @@ export class ContextMenuService extends Disposable implements IContextMenuServic
get onDidContextMenu(): Event<void> { return this._onDidContextMenu.event; }
constructor(
@INotificationService private notificationService: INotificationService,
@ITelemetryService private telemetryService: ITelemetryService,
@IKeybindingService private keybindingService: IKeybindingService
@INotificationService private readonly notificationService: INotificationService,
@ITelemetryService private readonly telemetryService: ITelemetryService,
@IKeybindingService private readonly keybindingService: IKeybindingService
) {
super();
}
@@ -39,7 +39,7 @@ export class ContextMenuService extends Disposable implements IContextMenuServic
if (actions.length) {
const onHide = once(() => {
if (delegate.onHide) {
delegate.onHide(undefined);
delegate.onHide(false);
}
this._onDidContextMenu.fire();
@@ -67,13 +67,13 @@ export class ContextMenuService extends Disposable implements IContextMenuServic
popup(menu, {
x: Math.floor(x),
y: Math.floor(y),
positioningItem: delegate.autoSelectFirstItem ? 0 : void 0,
positioningItem: delegate.autoSelectFirstItem ? 0 : undefined,
onHide: () => onHide()
});
}
}
private createMenu(delegate: IContextMenuDelegate, entries: (IAction | ContextSubMenu)[], onHide: () => void): IContextMenuItem[] {
private createMenu(delegate: IContextMenuDelegate, entries: Array<IAction | ContextSubMenu>, onHide: () => void): IContextMenuItem[] {
const actionRunner = delegate.actionRunner || new ActionRunner();
return entries.map(entry => this.createMenuItem(delegate, entry, actionRunner, onHide));
@@ -99,7 +99,7 @@ export class ContextMenuService extends Disposable implements IContextMenuServic
const item: IContextMenuItem = {
label: unmnemonicLabel(entry.label),
checked: !!entry.checked || !!entry.radio,
type: !!entry.checked ? 'checkbox' : !!entry.radio ? 'radio' : void 0,
type: !!entry.checked ? 'checkbox' : !!entry.radio ? 'radio' : undefined,
enabled: !!entry.enabled,
click: event => {
@@ -142,6 +142,6 @@ export class ContextMenuService extends Disposable implements IContextMenuServic
const context = delegate.getActionsContext ? delegate.getActionsContext(event) : event;
const res = actionRunner.run(actionToRun, context) || Promise.resolve(null);
res.then(null, e => this.notificationService.error(e));
res.then(undefined, e => this.notificationService.error(e));
}
}