mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-28 07:40:30 -04:00
Vscode merge (#4582)
* Merge from vscode 37cb23d3dd4f9433d56d4ba5ea3203580719a0bd * fix issues with merges * bump node version in azpipe * replace license headers * remove duplicate launch task * fix build errors * fix build errors * fix tslint issues * working through package and linux build issues * more work * wip * fix packaged builds * working through linux build errors * wip * wip * wip * fix mac and linux file limits * iterate linux pipeline * disable editor typing * revert series to parallel * remove optimize vscode from linux * fix linting issues * revert testing change * add work round for new node * readd packaging for extensions * fix issue with angular not resolving decorator dependencies
This commit is contained in:
@@ -9,10 +9,17 @@ import { Graph } from 'vs/platform/instantiation/common/graph';
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { ServiceIdentifier, IInstantiationService, ServicesAccessor, _util, optional } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { IdleValue } from 'vs/base/common/async';
|
||||
|
||||
// TRACING
|
||||
const _enableTracing = false;
|
||||
|
||||
// PROXY
|
||||
// Ghetto-declare of the global Proxy object. This isn't the proper way
|
||||
// but allows us to run this code in the browser without IE11.
|
||||
declare var Proxy: any;
|
||||
const _canUseProxy = typeof Proxy === 'function';
|
||||
|
||||
export class InstantiationService implements IInstantiationService {
|
||||
|
||||
_serviceBrand: any;
|
||||
@@ -151,7 +158,8 @@ export class InstantiationService implements IInstantiationService {
|
||||
|
||||
// TODO@joh use the graph to find a cycle
|
||||
// a weak heuristic for cycle checks
|
||||
if (count++ > 100) {
|
||||
// {{SQL CARBON EDIT}} we hit ~102 with our services; when they implement graph cycle; we can remove
|
||||
if (count++ > 200) {
|
||||
throwCycleError();
|
||||
}
|
||||
|
||||
@@ -205,8 +213,26 @@ export class InstantiationService implements IInstantiationService {
|
||||
}
|
||||
}
|
||||
|
||||
protected _createServiceInstance<T>(ctor: any, args: any[] = [], _supportsDelayedInstantiation: boolean, _trace: Trace): T {
|
||||
return this._createInstance(ctor, args, _trace);
|
||||
private _createServiceInstance<T>(ctor: any, args: any[] = [], _supportsDelayedInstantiation: boolean, _trace: Trace): T {
|
||||
if (!_supportsDelayedInstantiation || !_canUseProxy) {
|
||||
// eager instantiation or no support JS proxies (e.g. IE11)
|
||||
return this._createInstance(ctor, args, _trace);
|
||||
|
||||
} else {
|
||||
// Return a proxy object that's backed by an idle value. That
|
||||
// strategy is to instantiate services in our idle time or when actually
|
||||
// needed but not when injected into a consumer
|
||||
const idle = new IdleValue(() => this._createInstance(ctor, args, _trace));
|
||||
return <T>new Proxy(Object.create(null), {
|
||||
get(_target: T, prop: PropertyKey): any {
|
||||
return idle.getValue()[prop];
|
||||
},
|
||||
set(_target: T, p: PropertyKey, value: any): boolean {
|
||||
idle.getValue()[p] = value;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import { IdleValue } from 'vs/base/common/async';
|
||||
import { InstantiationService as BaseInstantiationService } from 'vs/platform/instantiation/common/instantiationService';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
// this is in the /node/-layer because it depends on Proxy which isn't available
|
||||
// in IE11 and therefore not in the /common/-layer
|
||||
|
||||
export class InstantiationService extends BaseInstantiationService {
|
||||
|
||||
createChild(services: ServiceCollection): IInstantiationService {
|
||||
return new InstantiationService(services, this._strict, this);
|
||||
}
|
||||
|
||||
protected _createServiceInstance<T>(ctor: any, args: any[] = [], supportsDelayedInstantiation: boolean, _trace): T {
|
||||
if (supportsDelayedInstantiation) {
|
||||
return InstantiationService._newIdleProxyService(() => super._createServiceInstance(ctor, args, supportsDelayedInstantiation, _trace));
|
||||
} else {
|
||||
return super._createServiceInstance(ctor, args, supportsDelayedInstantiation, _trace);
|
||||
}
|
||||
}
|
||||
|
||||
private static _newIdleProxyService<T>(executor: () => T): T {
|
||||
const idle = new IdleValue(executor);
|
||||
return <T>new Proxy(Object.create(null), {
|
||||
get(_target: T, prop: PropertyKey): any {
|
||||
return idle.getValue()[prop];
|
||||
},
|
||||
set(_target: T, p: PropertyKey, value: any): boolean {
|
||||
idle.getValue()[p] = value;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user