mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Initial VS Code 1.19 source merge (#571)
* Initial 1.19 xcopy * Fix yarn build * Fix numerous build breaks * Next batch of build break fixes * More build break fixes * Runtime breaks * Additional post merge fixes * Fix windows setup file * Fix test failures. * Update license header blocks to refer to source eula
This commit is contained in:
@@ -21,13 +21,13 @@ export class Menu implements IMenu {
|
||||
private _onDidChange = new Emitter<IMenu>();
|
||||
|
||||
constructor(
|
||||
private _id: MenuId,
|
||||
id: MenuId,
|
||||
startupSignal: TPromise<boolean>,
|
||||
@ICommandService private _commandService: ICommandService,
|
||||
@IContextKeyService private _contextKeyService: IContextKeyService
|
||||
) {
|
||||
startupSignal.then(_ => {
|
||||
const menuItems = MenuRegistry.getMenuItems(_id);
|
||||
const menuItems = MenuRegistry.getMenuItems(id);
|
||||
const keysFilter = new Set<string>();
|
||||
|
||||
let group: MenuItemGroup;
|
||||
@@ -47,15 +47,9 @@ export class Menu implements IMenu {
|
||||
}
|
||||
|
||||
// subscribe to context changes
|
||||
this._disposables.push(this._contextKeyService.onDidChangeContext(keys => {
|
||||
if (!keys) {
|
||||
return;
|
||||
}
|
||||
for (let k of keys) {
|
||||
if (keysFilter.has(k)) {
|
||||
this._onDidChange.fire();
|
||||
return;
|
||||
}
|
||||
this._disposables.push(this._contextKeyService.onDidChangeContext(event => {
|
||||
if (event.affectsSome(keysFilter)) {
|
||||
this._onDidChange.fire();
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
@@ -23,6 +23,6 @@ export class MenuService implements IMenuService {
|
||||
}
|
||||
|
||||
createMenu(id: MenuId, contextKeyService: IContextKeyService): IMenu {
|
||||
return new Menu(id, this._extensionService.onReady(), this._commandService, contextKeyService);
|
||||
return new Menu(id, this._extensionService.whenInstalledExtensionsRegistered(), this._commandService, contextKeyService);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,18 +12,27 @@ import { NullCommandService } from 'vs/platform/commands/common/commands';
|
||||
import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKeybindingService';
|
||||
import { IExtensionPoint } from 'vs/platform/extensions/common/extensionsRegistry';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { ExtensionPointContribution, IExtensionDescription, IExtensionsStatus, IExtensionService, ActivationTimes } from 'vs/platform/extensions/common/extensions';
|
||||
import { ExtensionPointContribution, IExtensionDescription, IExtensionsStatus, IExtensionService, ProfileSession } from 'vs/platform/extensions/common/extensions';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
|
||||
// --- service instances
|
||||
|
||||
class MockExtensionService implements IExtensionService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
|
||||
private _onDidRegisterExtensions = new Emitter<IExtensionDescription[]>();
|
||||
public get onDidRegisterExtensions(): Event<IExtensionDescription[]> {
|
||||
return this._onDidRegisterExtensions.event;
|
||||
}
|
||||
|
||||
onDidChangeExtensionsStatus = null;
|
||||
|
||||
public activateByEvent(activationEvent: string): TPromise<void> {
|
||||
throw new Error('Not implemented');
|
||||
}
|
||||
|
||||
public onReady(): TPromise<boolean> {
|
||||
public whenInstalledExtensionsRegistered(): TPromise<boolean> {
|
||||
return TPromise.as(true);
|
||||
}
|
||||
|
||||
@@ -39,7 +48,7 @@ class MockExtensionService implements IExtensionService {
|
||||
throw new Error('Not implemented');
|
||||
}
|
||||
|
||||
public getExtensionsActivationTimes(): { [id: string]: ActivationTimes; } {
|
||||
public startExtensionHostProfile(): TPromise<ProfileSession> {
|
||||
throw new Error('Not implemented');
|
||||
}
|
||||
|
||||
@@ -54,6 +63,10 @@ class MockExtensionService implements IExtensionService {
|
||||
public stopExtensionHost(): void {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public getExtensionHostInformation(): any {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
|
||||
const extensionService = new MockExtensionService();
|
||||
|
||||
Reference in New Issue
Block a user