Merge from vscode de81ccf04849309f843db21130c806a5783678f7 (#4738)

This commit is contained in:
Anthony Dresser
2019-03-28 13:06:16 -07:00
committed by GitHub
parent cc2951265e
commit e6785ffe95
77 changed files with 562 additions and 835 deletions

View File

@@ -34,6 +34,7 @@ import { ExtensionIdentifier, IExtension, ExtensionType, IExtensionDescription }
import { Schemas } from 'vs/base/common/network';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { IFileService } from 'vs/platform/files/common/files';
import { parseExtensionDevOptions } from 'vs/workbench/services/extensions/common/extensionDevOptions';
const hasOwnProperty = Object.hasOwnProperty;
const NO_OP_VOID_PROMISE = Promise.resolve<void>(undefined);
@@ -843,7 +844,16 @@ export class ExtensionService extends Disposable implements IExtensionService {
}
public _onExtensionHostExit(code: number): void {
ipc.send('vscode:exit', code);
// Expected development extension termination: When the extension host goes down we also shutdown the window
const devOpts = parseExtensionDevOptions(this._environmentService);
if (!devOpts.isExtensionDevTestFromCli) {
this._windowService.closeWindow();
}
// When CLI testing make sure to exit with proper exit code
else {
ipc.send('vscode:exit', code);
}
}
}

View File

@@ -287,7 +287,7 @@ function createPatchedModules(configProvider: ExtHostConfigProvider, resolveProx
};
configProvider.onDidChangeConfiguration(e => {
certSetting.config = !!configProvider.getConfiguration('http')
.get<string>('systemCertificates');
.get<boolean>('systemCertificates');
});
return {
@@ -332,9 +332,10 @@ function patches(originals: typeof http | typeof https, resolveProxy: ReturnType
return original.apply(null, arguments as unknown as any[]);
}
const optionsPatched = options.agent instanceof ProxyAgent;
const config = onRequest && ((<any>options)._vscodeProxySupport || /* LS */ (<any>options)._vscodeSystemProxy) || proxySetting.config;
const useProxySettings = (config === 'override' || config === 'on' && !options.agent) && !(options.agent instanceof ProxyAgent);
const useSystemCertificates = certSetting.config && originals === https && !(options as https.RequestOptions).ca;
const useProxySettings = !optionsPatched && (config === 'override' || config === 'on' && !options.agent);
const useSystemCertificates = !optionsPatched && certSetting.config && originals === https && !(options as https.RequestOptions).ca;
if (useProxySettings || useSystemCertificates) {
if (url) {