mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 09:08:53 +01:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user