mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
@@ -405,8 +405,8 @@ export function createApiFactory(
|
||||
registerDecorationProvider: proposedApiFunction(extension, (provider: vscode.DecorationProvider) => {
|
||||
return extHostDecorations.registerDecorationProvider(provider, extension.id);
|
||||
}),
|
||||
createWebview: proposedApiFunction(extension, (uri: vscode.Uri, column: vscode.ViewColumn, options: vscode.WebviewOptions) => {
|
||||
return extHostWebviews.createWebview(uri, column, options);
|
||||
createWebview: proposedApiFunction(extension, (uri: vscode.Uri, title: string, column: vscode.ViewColumn, options: vscode.WebviewOptions) => {
|
||||
return extHostWebviews.createWebview(uri, title, column, options);
|
||||
}),
|
||||
onDidChangeActiveEditor: proposedApiFunction(extension, (listener, thisArg?, disposables?) => {
|
||||
return extHostDocumentsAndEditors.onDidChangeActiveEditor(listener, thisArg, disposables);
|
||||
|
||||
@@ -345,7 +345,7 @@ export interface MainThreadTelemetryShape extends IDisposable {
|
||||
export type WebviewHandle = number;
|
||||
|
||||
export interface MainThreadWebviewsShape extends IDisposable {
|
||||
$createWebview(handle: WebviewHandle, uri: URI, options: vscode.WebviewOptions): void;
|
||||
$createWebview(handle: WebviewHandle, uri: URI, title: string, column: EditorPosition, options: vscode.WebviewOptions): void;
|
||||
$disposeWebview(handle: WebviewHandle): void;
|
||||
$show(handle: WebviewHandle, column: EditorPosition): void;
|
||||
$setTitle(handle: WebviewHandle, value: string): void;
|
||||
|
||||
@@ -127,18 +127,15 @@ export class ExtHostWebviews implements ExtHostWebviewsShape {
|
||||
|
||||
createWebview(
|
||||
uri: vscode.Uri,
|
||||
title: string,
|
||||
viewColumn: vscode.ViewColumn,
|
||||
options: vscode.WebviewOptions
|
||||
): vscode.Webview {
|
||||
const handle = ExtHostWebviews.handlePool++;
|
||||
if (!this._webviews.has(handle)) {
|
||||
this._proxy.$createWebview(handle, uri, options);
|
||||
this._proxy.$createWebview(handle, uri, title, typeConverters.fromViewColumn(viewColumn), options);
|
||||
|
||||
const webview = new ExtHostWebview(handle, this._proxy, uri, viewColumn, options);
|
||||
this._webviews.set(handle, webview);
|
||||
}
|
||||
|
||||
this._proxy.$show(handle, typeConverters.fromViewColumn(viewColumn));
|
||||
const webview = new ExtHostWebview(handle, this._proxy, uri, viewColumn, options);
|
||||
this._webviews.set(handle, webview);
|
||||
return this._webviews.get(handle);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user