message: Clear notification handlers when infoview is closed.
diff: @@ -172,6 +172,7 @@ export class InfoProvider implements Disposable {
  }
  dispose(): void {
  + this.clearNotificationHandlers();
  for (const s of this.subscriptions) { s.dispose(); }
  }
  @@ -199,6 +200,13 @@ export class InfoProvider implements Disposable {
  }
  }
  + private clearNotificationHandlers() {
  + for (const [, [, h]] of this.clientNotifSubscriptions) h.dispose();
  + this.clientNotifSubscriptions.clear();
  + for (const [, [, h]] of this.serverNotifSubscriptions) h.dispose();
  + this.serverNotifSubscriptions.clear();
  + }
  +
  private async openPreview(editor: TextEditor) {
  let column = editor ? editor.viewColumn + 1 : ViewColumn.Two;
  if (column === 4) { column = ViewColumn.Three; }
  @@ -226,6 +234,7 @@ export class InfoProvider implements Disposable {
  webviewPanel.webview.onDidReceiveMessage(m => webviewPanel.rpc.messageReceived(m))
  webviewPanel.api = webviewPanel.rpc.getApi();
  webviewPanel.onDidDispose(() => {
  + this.clearNotificationHandlers();
  this.webviewPanel = undefined;
  });
  this.webviewPanel = webviewPanel;
  