Merge from vscode e1d3dd53d17fb1529a002e4d6fb066db0a0bd385 (#6460)

* Merge from vscode e1d3dd53d17fb1529a002e4d6fb066db0a0bd385

* fix servers icon

* fix tests
This commit is contained in:
Anthony Dresser
2019-07-22 18:28:21 -07:00
committed by GitHub
parent f2afacd8b2
commit 15fc7a077a
91 changed files with 2562 additions and 972 deletions

View File

@@ -45,7 +45,9 @@ export class IFrameWebview extends Disposable implements Webview {
@IConfigurationService private readonly _configurationService: IConfigurationService,
) {
super();
if (typeof environmentService.webviewEndpoint !== 'string') {
const useExternalEndpoint = this._configurationService.getValue<string>('webview.experimental.useExternalEndpoint');
if (typeof environmentService.webviewEndpoint !== 'string' && !useExternalEndpoint) {
throw new Error('To use iframe based webviews, you must configure `environmentService.webviewEndpoint`');
}
@@ -142,7 +144,9 @@ export class IFrameWebview extends Disposable implements Webview {
}
private get endpoint(): string {
const endpoint = this.environmentService.webviewEndpoint!.replace('{{uuid}}', this.id);
const useExternalEndpoint = this._configurationService.getValue<string>('webview.experimental.useExternalEndpoint');
const baseEndpoint = useExternalEndpoint ? 'https://{{uuid}}.vscode-webview-test.com/8fa811108f0f0524c473020ef57b6620f6c201e1' : this.environmentService.webviewEndpoint!;
const endpoint = baseEndpoint.replace('{{uuid}}', this.id);
if (endpoint[endpoint.length - 1] === '/') {
return endpoint.slice(0, endpoint.length - 1);
}