Webview Api Prototype (#42690)

* Webview api

* Cleaning up markdown webview

* Hooking up dispose

* Fix some merge errors

* Use custom context key to show markdown title bar contributions

* Add basic on focus and on blur events

* Fixing find widget in webview

* Hookup _isDisposed

* Use new extension resource scheme to load markdown extension resources

* Documenting keep alive
This commit is contained in:
Matt Bierner
2018-02-14 18:52:26 -08:00
committed by GitHub
parent dbcf30ddbc
commit 3412eab2ec
26 changed files with 889 additions and 196 deletions

View File

@@ -345,6 +345,21 @@ export interface MainThreadTelemetryShape extends IDisposable {
$publicLog(eventName: string, data?: any): void;
}
export interface MainThreadWebviewShape extends IDisposable {
$createWebview(handle: number): void;
$disposeWebview(handle: number): void;
$show(handle: number, column: EditorPosition): void;
$setTitle(handle: number, value: string): void;
$setHtml(handle: number, value: string): void;
$setOptions(handle: number, value: vscode.WebviewOptions): void;
$sendMessage(handle: number, value: any): Thenable<boolean>;
}
export interface ExtHostWebviewsShape {
$onMessage(handle: number, message: any): void;
$onBecameActive(handle: number): void;
$onBecameInactive(handle: number): void;
}
export interface MainThreadWorkspaceShape extends IDisposable {
$startSearch(includePattern: string, includeFolder: string, excludePatternOrDisregardExcludes: string | false, maxResults: number, requestId: number): Thenable<UriComponents[]>;
$cancelSearch(requestId: number): Thenable<boolean>;
@@ -796,6 +811,7 @@ export const MainContext = {
MainThreadStorage: createMainId<MainThreadStorageShape>('MainThreadStorage'),
MainThreadTelemetry: createMainId<MainThreadTelemetryShape>('MainThreadTelemetry'),
MainThreadTerminalService: createMainId<MainThreadTerminalServiceShape>('MainThreadTerminalService'),
MainThreadWebview: createMainId<MainThreadWebviewShape>('MainThreadWebview'),
MainThreadWorkspace: createMainId<MainThreadWorkspaceShape>('MainThreadWorkspace'),
MainThreadFileSystem: createMainId<MainThreadFileSystemShape>('MainThreadFileSystem'),
MainThreadExtensionService: createMainId<MainThreadExtensionServiceShape>('MainThreadExtensionService'),
@@ -828,4 +844,5 @@ export const ExtHostContext = {
ExtHostTask: createExtId<ExtHostTaskShape>('ExtHostTask'),
ExtHostWorkspace: createExtId<ExtHostWorkspaceShape>('ExtHostWorkspace'),
ExtHostWindow: createExtId<ExtHostWindowShape>('ExtHostWindow'),
ExtHostWebviews: createExtId<ExtHostWebviewsShape>('ExtHostWebviews')
};