Removing webview widget api. Will go with more declarative approach

This commit is contained in:
Matt Bierner
2018-04-10 15:32:55 -07:00
parent 5dd148f919
commit bd83b6da57
6 changed files with 5 additions and 31 deletions

View File

@@ -423,9 +423,6 @@ export function createApiFactory(
}),
registerWebviewSerializer: proposedApiFunction(extension, (viewType: string, serializer: vscode.WebviewSerializer) => {
return extHostWebviews.registerWebviewSerializer(viewType, serializer);
}),
showWebviewWidget: proposedApiFunction(extension, (editor: vscode.TextEditor, position: vscode.Position, viewType: string, title: string, options: vscode.WebviewOptions) => {
return extHostWebviews.showWebviewWidget(editor, position, viewType, title, options);
})
};

View File

@@ -364,8 +364,6 @@ export interface MainThreadWebviewsShape extends IDisposable {
$registerSerializer(viewType: string): void;
$unregisterSerializer(viewType: string): void;
$showWebviewWidget(handle: WebviewHandle, editorId: string, position: IPosition, viewType: string, options: vscode.WebviewOptions): void;
}
export interface ExtHostWebviewsShape {

View File

@@ -3,14 +3,13 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { MainContext, MainThreadWebviewsShape, IMainContext, ExtHostWebviewsShape, WebviewHandle } from './extHost.protocol';
import * as vscode from 'vscode';
import { Event, Emitter } from 'vs/base/common/event';
import * as typeConverters from 'vs/workbench/api/node/extHostTypeConverters';
import { Position } from 'vs/platform/editor/common/editor';
import { Emitter, Event } from 'vs/base/common/event';
import { TPromise } from 'vs/base/common/winjs.base';
import { Position } from 'vs/platform/editor/common/editor';
import * as typeConverters from 'vs/workbench/api/node/extHostTypeConverters';
import * as vscode from 'vscode';
import { ExtHostWebviewsShape, IMainContext, MainContext, MainThreadWebviewsShape, WebviewHandle } from './extHost.protocol';
import * as types from './extHostTypes';
import { ExtHostTextEditor } from './extHostTextEditor';
export class ExtHostWebview implements vscode.Webview {
@@ -179,15 +178,6 @@ export class ExtHostWebviews implements ExtHostWebviewsShape {
});
}
async showWebviewWidget(editor: vscode.TextEditor, position: vscode.Position, viewType: string, title: string, options: vscode.WebviewOptions) {
const handle = ExtHostWebviews.webviewHandlePool++ + '';
this._proxy.$showWebviewWidget(handle, (editor as ExtHostTextEditor).id, typeConverters.fromPosition(new types.Position(position.line, position.character)), viewType, options);
const webview = new ExtHostWebview(handle, this._proxy, viewType, undefined, options);
this._webviews.set(handle, webview);
return webview;
}
$onMessage(handle: WebviewHandle, message: any): void {
const webview = this.getWebview(handle);
if (webview) {