Add WebviewView.description

Allow configuring the description for webview views.

This is rendered next to the title in a less prominently in the title
This commit is contained in:
Matt Bierner
2020-09-08 15:23:43 -07:00
parent 1fbd17331e
commit 4c7071e9ab
6 changed files with 45 additions and 8 deletions

View File

@@ -23,6 +23,7 @@ class ExtHostWebviewView extends Disposable implements vscode.WebviewView {
#isDisposed = false;
#isVisible: boolean;
#title: string | undefined;
#description: string | undefined;
constructor(
handle: extHostProtocol.WebviewHandle,
@@ -70,6 +71,19 @@ class ExtHostWebviewView extends Disposable implements vscode.WebviewView {
}
}
public get description(): string | undefined {
this.assertNotDisposed();
return this.#description;
}
public set description(value: string | undefined) {
this.assertNotDisposed();
if (this.#description !== value) {
this.#description = value;
this.#proxy.$setWebviewViewDescription(this.#handle, value);
}
}
public get visible(): boolean { return this.#isVisible; }
public get webview(): vscode.Webview { return this.#webview; }