提交 c50b5acd 编写于 作者: M Matt Bierner

Fix local resources in webview views

Ensure we use the correct id for identifying the webview internally
上级 041cf5dd
......@@ -45,7 +45,7 @@ export class MainThreadWebviewsViews extends Disposable {
resolve: async (webviewView: WebviewView, cancellation: CancellationToken) => {
this._webviewViews.set(viewType, webviewView);
const handle = viewType;
const handle = webviewView.webview.id;
this.mainThreadWebviews.addWebview(handle, webviewView.webview);
let state = undefined;
......
......@@ -81,8 +81,7 @@ export abstract class BaseWebview<T extends HTMLElement> extends Disposable {
protected content: WebviewContent;
constructor(
// TODO: matb, this should not be protected. The only reason it needs to be is that the base class ends up using it in the call to createElement
protected readonly id: string,
public readonly id: string,
options: WebviewOptions,
contentOptions: WebviewContentOptions,
public readonly extension: WebviewExtensionDescription | undefined,
......
......@@ -39,7 +39,7 @@ export class DynamicWebviewEditorOverlay extends Disposable implements WebviewOv
private _findWidgetVisible: IContextKey<boolean>;
public constructor(
private readonly id: string,
public readonly id: string,
initialOptions: WebviewOptions,
initialContentOptions: WebviewContentOptions,
public readonly extension: WebviewExtensionDescription | undefined,
......
......@@ -86,6 +86,9 @@ export interface IDataLinkClickEvent {
}
export interface Webview extends IDisposable {
readonly id: string;
html: string;
contentOptions: WebviewContentOptions;
localResourcesRoot: URI[];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册