mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 09:38:38 +01:00
Adding tests and changing how toWebviewResource works
- Allow placeholders in the webviewEndpoint. This is required to support serving each webview from its own origin - Add tests for toWebviewResource
This commit is contained in:
@@ -11,6 +11,7 @@ import { ExtHostEditors } from 'vs/workbench/api/common/extHostTextEditors';
|
||||
import * as vscode from 'vscode';
|
||||
import { ExtHostEditorInsetsShape, MainThreadEditorInsetsShape } from './extHost.protocol';
|
||||
import { toWebviewResource, WebviewInitData } from 'vs/workbench/api/common/shared/webview';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
|
||||
export class ExtHostEditorInsets implements ExtHostEditorInsetsShape {
|
||||
|
||||
@@ -60,11 +61,12 @@ export class ExtHostEditorInsets implements ExtHostEditorInsetsShape {
|
||||
|
||||
const webview = new class implements vscode.Webview {
|
||||
|
||||
private readonly _uuid = generateUuid();
|
||||
private _html: string = '';
|
||||
private _options: vscode.WebviewOptions;
|
||||
|
||||
toWebviewResource(resource: vscode.Uri): vscode.Uri {
|
||||
return toWebviewResource(that._initData, resource);
|
||||
return toWebviewResource(that._initData, this._uuid, resource);
|
||||
}
|
||||
|
||||
get cspRule(): string {
|
||||
|
||||
Reference in New Issue
Block a user