Skip to content

Commit 21fef3b

Browse files
authored
use WebviewPanel (#2781) (#2783)
1 parent 71582d1 commit 21fef3b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Extension/src/common.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,16 @@ export function getProgressExecutableSuccess(): number { return progressExecutab
167167
export function getProgressParseRootSuccess(): number { return progressParseRootSuccess; } // Parse root was successful (i.e. not blocked by processing taking too long).
168168
export function getProgressIntelliSenseNoSquiggles(): number { return progressIntelliSenseNoSquiggles; } // IntelliSense was successful and the user got no squiggles.
169169

170-
export function showReleaseNotes(): void {
171-
vscode.commands.executeCommand('vscode.previewHtml', vscode.Uri.file(getExtensionFilePath("ReleaseNotes.html")), vscode.ViewColumn.One, "C/C++ Extension Release Notes");
170+
let releaseNotesPanel: vscode.WebviewPanel = undefined;
171+
172+
export async function showReleaseNotes(): Promise<void> {
173+
if (releaseNotesPanel) {
174+
releaseNotesPanel.reveal();
175+
} else {
176+
releaseNotesPanel = vscode.window.createWebviewPanel('releaseNotes', "C/C++ Extension Release Notes", vscode.ViewColumn.One);
177+
releaseNotesPanel.webview.html = await readFileText(getExtensionFilePath("ReleaseNotes.html"));
178+
releaseNotesPanel.onDidDispose(() => releaseNotesPanel = undefined, null, extensionContext.subscriptions);
179+
}
172180
}
173181

174182
export function isUri(input: any): input is vscode.Uri {

0 commit comments

Comments
 (0)