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:
Anthony Dresser
2019-03-19 17:44:35 -07:00
committed by GitHub
parent 833d197412
commit 87765e8673
1879 changed files with 54505 additions and 38058 deletions

View File

@@ -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;
}
});
}
}
}