Use viewType instead of uri for webviews

As discussed in #45994, move from using a uri to using a viewType. The view type is shared among all webviews of a given type, such as all markdown previews

Fixes #44575
This commit is contained in:
Matt Bierner
2018-03-20 14:44:10 -07:00
parent 18146e8c71
commit ea1fed9616
6 changed files with 27 additions and 21 deletions

View File

@@ -46,8 +46,15 @@ export class MainThreadWebviews implements MainThreadWebviewsShape {
this._toDispose = dispose(this._toDispose);
}
$createWebview(handle: WebviewHandle, uri: URI, title: string, column: Position, options: vscode.WebviewOptions, extensionFolderPath: string): void {
const webviewInput = new WebviewInput(URI.revive(uri), title, options, '', {
$createWebview(
handle: WebviewHandle,
viewType: string,
title: string,
column: Position,
options: vscode.WebviewOptions,
extensionFolderPath: string
): void {
const webviewInput = new WebviewInput(URI.parse('webview://' + handle), title, options, '', {
onMessage: message => this._proxy.$onMessage(handle, message),
onDidChangePosition: position => this._proxy.$onDidChangePosition(handle, position),
onDispose: () => {