Use extension location instead of remote for asWebviewUri

This commit is contained in:
Matt Bierner
2021-05-20 10:32:36 -07:00
parent 0b355ffc89
commit 2270c36cff
3 changed files with 15 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ import type * as vscode from 'vscode';
import { ExtHostEditorInsetsShape, MainThreadEditorInsetsShape } from './extHost.protocol';
import { asWebviewUri, webviewGenericCspSource, WebviewInitData } from 'vs/workbench/api/common/shared/webview';
import { generateUuid } from 'vs/base/common/uuid';
import { Schemas } from 'vs/base/common/network';
export class ExtHostEditorInsets implements ExtHostEditorInsetsShape {
@@ -66,7 +67,10 @@ export class ExtHostEditorInsets implements ExtHostEditorInsetsShape {
private _options: vscode.WebviewOptions = Object.create(null);
asWebviewUri(resource: vscode.Uri): vscode.Uri {
return asWebviewUri(this._uuid, resource, that._initData.remote.authority);
const remoteAuthority = extension.extensionLocation.scheme === Schemas.vscodeRemote
? that._initData.remote.authority
: undefined;
return asWebviewUri(this._uuid, resource, remoteAuthority);
}
get cspSource(): string {