Make MethodModelingViewProvider a disposable object (#2862)

This commit is contained in:
Charis Kyriakou
2023-09-26 13:53:23 +01:00
committed by GitHub
parent cbb1de4faf
commit 93251f8d57
2 changed files with 9 additions and 2 deletions

View File

@@ -11,6 +11,7 @@ export class MethodModelingPanel extends DisposableObject {
super();
this.provider = new MethodModelingViewProvider(app);
this.push(this.provider);
this.push(
window.registerWebviewViewProvider(
MethodModelingViewProvider.viewType,

View File

@@ -8,13 +8,19 @@ import { extLogger } from "../../common/logging/vscode/loggers";
import { App } from "../../common/app";
import { redactableError } from "../../common/errors";
import { Method } from "../method";
import { DisposableObject } from "../../common/disposable-object";
export class MethodModelingViewProvider implements WebviewViewProvider {
export class MethodModelingViewProvider
extends DisposableObject
implements WebviewViewProvider
{
public static readonly viewType = "codeQLMethodModeling";
private webviewView: vscode.WebviewView | undefined = undefined;
constructor(private readonly app: App) {}
constructor(private readonly app: App) {
super();
}
/**
* This is called when a view first becomes visible. This may happen when the view is