mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-14 12:08:36 -05:00
Merge VS Code 1.21 source code (#1067)
* Initial VS Code 1.21 file copy with patches * A few more merges * Post npm install * Fix batch of build breaks * Fix more build breaks * Fix more build errors * Fix more build breaks * Runtime fixes 1 * Get connection dialog working with some todos * Fix a few packaging issues * Copy several node_modules to package build to fix loader issues * Fix breaks from master * A few more fixes * Make tests pass * First pass of license header updates * Second pass of license header updates * Fix restore dialog issues * Remove add additional themes menu items * fix select box issues where the list doesn't show up * formatting * Fix editor dispose issue * Copy over node modules to correct location on all platforms
This commit is contained in:
@@ -6,29 +6,35 @@
|
||||
'use strict';
|
||||
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import severity from 'vs/base/common/severity';
|
||||
import { IAction, IActionRunner, ActionRunner } from 'vs/base/common/actions';
|
||||
import { Separator } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import dom = require('vs/base/browser/dom');
|
||||
import { IContextMenuService, IContextMenuDelegate, ContextSubMenu, IEvent } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IMessageService } from 'vs/platform/message/common/message';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
|
||||
import { remote, webFrame } from 'electron';
|
||||
import { unmnemonicLabel } from 'vs/base/common/labels';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { IContextMenuDelegate, ContextSubMenu, IEvent } from 'vs/base/browser/contextmenu';
|
||||
|
||||
export class ContextMenuService implements IContextMenuService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
private _onDidContextMenu = new Emitter<void>();
|
||||
|
||||
constructor(
|
||||
@IMessageService private messageService: IMessageService,
|
||||
@INotificationService private notificationService: INotificationService,
|
||||
@ITelemetryService private telemetryService: ITelemetryService,
|
||||
@IKeybindingService private keybindingService: IKeybindingService
|
||||
) {
|
||||
}
|
||||
|
||||
public get onDidContextMenu(): Event<void> {
|
||||
return this._onDidContextMenu.event;
|
||||
}
|
||||
|
||||
public showContextMenu(delegate: IContextMenuDelegate): void {
|
||||
delegate.getActions().then(actions => {
|
||||
if (!actions.length) {
|
||||
@@ -56,6 +62,7 @@ export class ContextMenuService implements IContextMenuService {
|
||||
y *= zoom;
|
||||
|
||||
menu.popup(remote.getCurrentWindow(), { x: Math.floor(x), y: Math.floor(y), positioningItem: delegate.autoSelectFirstItem ? 0 : void 0 });
|
||||
this._onDidContextMenu.fire();
|
||||
if (delegate.onHide) {
|
||||
delegate.onHide(undefined);
|
||||
}
|
||||
@@ -122,6 +129,6 @@ export class ContextMenuService implements IContextMenuService {
|
||||
const context = delegate.getActionsContext ? delegate.getActionsContext(event) : event;
|
||||
const res = actionRunner.run(actionToRun, context) || TPromise.as(null);
|
||||
|
||||
res.done(null, e => this.messageService.show(severity.Error, e));
|
||||
res.done(null, e => this.notificationService.error(e));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user