mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Rename webview.show to webview.reveal
Make it more clear that this command only reveals an existing webview Fixes #44580
This commit is contained in:
parent
683f86041c
commit
67d8eebaf4
|
@ -189,8 +189,8 @@ export class MarkdownPreview {
|
|||
return this.matchesResource(otherPreview._resource, otherPreview.viewColumn, otherPreview.locked);
|
||||
}
|
||||
|
||||
public show(viewColumn: vscode.ViewColumn) {
|
||||
this.webview.show(viewColumn);
|
||||
public reveal(viewColumn: vscode.ViewColumn) {
|
||||
this.webview.reveal(viewColumn);
|
||||
}
|
||||
|
||||
public toggleLock() {
|
||||
|
|
|
@ -63,7 +63,7 @@ export class MarkdownPreviewManager {
|
|||
): void {
|
||||
let preview = this.getExistingPreview(resource, previewSettings);
|
||||
if (preview) {
|
||||
preview.show(previewSettings.previewColumn);
|
||||
preview.reveal(previewSettings.previewColumn);
|
||||
} else {
|
||||
preview = this.createNewPreview(resource, previewSettings);
|
||||
this.previews.push(preview);
|
||||
|
|
4
src/vs/vscode.proposed.d.ts
vendored
4
src/vs/vscode.proposed.d.ts
vendored
|
@ -634,10 +634,10 @@ declare module 'vscode' {
|
|||
/**
|
||||
* Shows the webview in a given column.
|
||||
*
|
||||
* A webview may only show in a single column at a time. If it is already showing, this
|
||||
* A webview may only be in a single column at a time. If it is already showing, this
|
||||
* command moves it to a new column.
|
||||
*/
|
||||
show(viewColumn: ViewColumn): void;
|
||||
reveal(viewColumn: ViewColumn): void;
|
||||
|
||||
/**
|
||||
* Dispose of the the webview.
|
||||
|
|
|
@ -87,7 +87,7 @@ export class MainThreadWebviews implements MainThreadWebviewsShape {
|
|||
webview.setHtml(value);
|
||||
}
|
||||
|
||||
$show(handle: WebviewHandle, column: Position): void {
|
||||
$reveal(handle: WebviewHandle, column: Position): void {
|
||||
const webviewInput = this.getWebview(handle);
|
||||
if (webviewInput.position === column) {
|
||||
this._editorService.openEditor(webviewInput, { preserveFocus: true }, column);
|
||||
|
|
|
@ -352,7 +352,7 @@ export type WebviewHandle = number;
|
|||
export interface MainThreadWebviewsShape extends IDisposable {
|
||||
$createWebview(handle: WebviewHandle, viewType: string, title: string, column: EditorPosition, options: vscode.WebviewOptions, extensionFolderPath: string): void;
|
||||
$disposeWebview(handle: WebviewHandle): void;
|
||||
$show(handle: WebviewHandle, column: EditorPosition): void;
|
||||
$reveal(handle: WebviewHandle, column: EditorPosition): void;
|
||||
$setTitle(handle: WebviewHandle, value: string): void;
|
||||
$setHtml(handle: WebviewHandle, value: string): void;
|
||||
$sendMessage(handle: WebviewHandle, value: any): Thenable<boolean>;
|
||||
|
|
|
@ -115,9 +115,9 @@ export class ExtHostWebview implements vscode.Webview {
|
|||
return this._proxy.$sendMessage(this._handle, message);
|
||||
}
|
||||
|
||||
public show(viewColumn: vscode.ViewColumn): void {
|
||||
public reveal(viewColumn: vscode.ViewColumn): void {
|
||||
this.assertNotDisposed();
|
||||
this._proxy.$show(this._handle, typeConverters.fromViewColumn(viewColumn));
|
||||
this._proxy.$reveal(this._handle, typeConverters.fromViewColumn(viewColumn));
|
||||
}
|
||||
|
||||
private assertNotDisposed() {
|
||||
|
|
Loading…
Reference in a new issue