Promote webview Api to stable (#47989)

* Promote webview Api to stable

Fixes #43713
Fixes #28263

* Rename position back to viewColumn and mark viewColumn as deprecated

This allows us to more easily re-introduce a `position` property once we have gridlayout

* Move dispose methods onto webview itself

Also better hide a few 'internal' methods / properties on the panel / webview

* Revert "Move dispose methods onto webview itself"

This reverts commit 8fab6cc1a1.

* Move title onto webview panel

* Use _ names for private setters

* Remove unused emitter and dispose onMessageEmitter

* Preview internal emitters with _
This commit is contained in:
Matt Bierner
2018-04-19 10:55:49 -07:00
committed by GitHub
parent d907469a09
commit 91191fb866
5 changed files with 227 additions and 224 deletions

View File

@@ -236,7 +236,7 @@ export class MarkdownPreview {
}
public get position(): vscode.ViewColumn | undefined {
return this.editor.position;
return this.editor.viewColumn;
}
public isWebviewOf(webview: vscode.WebviewPanel): boolean {
@@ -269,7 +269,7 @@ export class MarkdownPreview {
public toggleLock() {
this._locked = !this._locked;
this.editor.webview.title = MarkdownPreview.getPreviewTitle(this._resource, this._locked);
this.editor.title = MarkdownPreview.getPreviewTitle(this._resource, this._locked);
}
private isPreviewOf(resource: vscode.Uri): boolean {
@@ -327,7 +327,7 @@ export class MarkdownPreview {
this.currentVersion = { resource, version: document.version };
const content = await this._contentProvider.provideTextDocumentContent(document, this._previewConfigurations, this.line);
if (this._resource === resource) {
this.editor.webview.title = MarkdownPreview.getPreviewTitle(this._resource, this._locked);
this.editor.title = MarkdownPreview.getPreviewTitle(this._resource, this._locked);
this.editor.webview.html = content;
}
}