Switch to use vscode-resource scheme in webviews

Fixes #45784
This commit is contained in:
Matt Bierner
2018-03-14 11:25:29 -07:00
parent a2ac383fba
commit 82084be1bc
19 changed files with 194 additions and 144 deletions

View File

@@ -413,7 +413,7 @@ export function createApiFactory(
return extHostDecorations.registerDecorationProvider(provider, extension.id);
}),
createWebview: proposedApiFunction(extension, (uri: vscode.Uri, title: string, column: vscode.ViewColumn, options: vscode.WebviewOptions) => {
return extHostWebviews.createWebview(uri, title, column, options);
return extHostWebviews.createWebview(uri, title, column, options, extension.extensionFolderPath);
}),
onDidChangeActiveEditor: proposedApiFunction(extension, (listener, thisArg?, disposables?) => {
return extHostDocumentsAndEditors.onDidChangeActiveEditor(listener, thisArg, disposables);

View File

@@ -345,7 +345,7 @@ export interface MainThreadTelemetryShape extends IDisposable {
export type WebviewHandle = number;
export interface MainThreadWebviewsShape extends IDisposable {
$createWebview(handle: WebviewHandle, uri: URI, title: string, column: EditorPosition, options: vscode.WebviewOptions): void;
$createWebview(handle: WebviewHandle, uri: URI, title: string, column: EditorPosition, options: vscode.WebviewOptions, extensionFolderPath: string): void;
$disposeWebview(handle: WebviewHandle): void;
$show(handle: WebviewHandle, column: EditorPosition): void;
$setTitle(handle: WebviewHandle, value: string): void;

View File

@@ -132,10 +132,11 @@ export class ExtHostWebviews implements ExtHostWebviewsShape {
uri: vscode.Uri,
title: string,
viewColumn: vscode.ViewColumn,
options: vscode.WebviewOptions
options: vscode.WebviewOptions,
extensionFolderPath: string
): vscode.Webview {
const handle = ExtHostWebviews.handlePool++;
this._proxy.$createWebview(handle, uri, title, typeConverters.fromViewColumn(viewColumn), options);
this._proxy.$createWebview(handle, uri, title, typeConverters.fromViewColumn(viewColumn), options, extensionFolderPath);
const webview = new ExtHostWebview(handle, this._proxy, uri, viewColumn, options);
this._webviews.set(handle, webview);