Rename webview.viewColumn to the more generic webview.position

This commit is contained in:
Matt Bierner 2018-04-12 14:25:55 -07:00
parent e16ec3c1ff
commit 4f880aaf59
3 changed files with 17 additions and 17 deletions

View file

@ -223,8 +223,8 @@ export class MarkdownPreview {
}
}
public get viewColumn(): vscode.ViewColumn | undefined {
return this.editor.viewColumn;
public get position(): vscode.ViewColumn | undefined {
return this.editor.position;
}
public isPreviewOf(resource: vscode.Uri): boolean {
@ -237,10 +237,10 @@ export class MarkdownPreview {
public matchesResource(
otherResource: vscode.Uri,
otherViewColumn: vscode.ViewColumn | undefined,
otherPosition: vscode.ViewColumn | undefined,
otherLocked: boolean
): boolean {
if (this.viewColumn !== otherViewColumn) {
if (this.position !== otherPosition) {
return false;
}
@ -252,7 +252,7 @@ export class MarkdownPreview {
}
public matches(otherPreview: MarkdownPreview): boolean {
return this.matchesResource(otherPreview._resource, otherPreview.viewColumn, otherPreview.locked);
return this.matchesResource(otherPreview._resource, otherPreview.position, otherPreview.locked);
}
public reveal(viewColumn: vscode.ViewColumn) {

View file

@ -687,9 +687,9 @@ declare module 'vscode' {
readonly options: WebviewPanelOptions;
/**
* The column in which the panel is showing.
* The editor position of the panel.
*/
readonly viewColumn?: ViewColumn;
readonly position?: ViewColumn;
/**
* Is the panel current visible?

View file

@ -150,22 +150,22 @@ export class ExtHostWebviewPanel implements vscode.WebviewPanel {
return this._options;
}
get viewColumn(): vscode.ViewColumn {
get position(): vscode.ViewColumn {
this.assertNotDisposed();
return this._viewColumn;
}
set position(value: vscode.ViewColumn) {
this.assertNotDisposed();
this._viewColumn = value;
}
get visible(): boolean {
this.assertNotDisposed();
return this._visible;
}
set viewColumn(value: vscode.ViewColumn) {
this.assertNotDisposed();
this._viewColumn = value;
}
set active(value: boolean) {
set visible(value: boolean) {
this.assertNotDisposed();
this._visible = value;
}
@ -244,9 +244,9 @@ export class ExtHostWebviews implements ExtHostWebviewsShape {
const panel = this.getWebviewPanel(handle);
if (panel) {
const viewColumn = typeConverters.toViewColumn(position);
if (panel.active !== active || panel.viewColumn !== viewColumn) {
panel.active = active;
panel.viewColumn = viewColumn;
if (panel.visible !== active || panel.position !== viewColumn) {
panel.visible = active;
panel.position = viewColumn;
panel.onDidChangeViewStateEmitter.fire({ webviewPanel: panel });
}
}