Avoid opening the results panel on db deletion

Fixes https://github.com/github/vscode-codeql/issues/823
This commit is contained in:
Andrew Eisenberg
2021-04-14 13:21:16 -07:00
parent aa60fbc213
commit bf5ed193be
2 changed files with 18 additions and 3 deletions

View File

@@ -4,6 +4,7 @@
- Avoid showing an error popup when user runs a query with `@kind table` metadata. [#814](https://github.com/github/vscode-codeql/pull/814)
- Add an option to jump from a .qlref file to the .ql file it references. [#815](https://github.com/github/vscode-codeql/pull/815)
- Avoid opening the results panel when a database is deleted. [#831](https://github.com/github/vscode-codeql/pull/831)
## 1.4.5 - 22 March 2021

View File

@@ -137,9 +137,11 @@ export class InterfaceManager extends DisposableObject {
this.databaseManager.onDidChangeDatabaseItem(({ kind }) => {
if (kind === DatabaseEventKind.Remove) {
this._diagnosticCollection.clear();
this.postMessage({
t: 'untoggleShowProblems'
});
if (this.isShowingPanel()) {
this.postMessage({
t: 'untoggleShowProblems'
});
}
}
})
);
@@ -149,6 +151,10 @@ export class InterfaceManager extends DisposableObject {
this.postMessage({ t: 'navigatePath', direction });
}
private isShowingPanel() {
return !!this._panel;
}
// Returns the webview panel, creating it if it doesn't already
// exist.
getPanel(): vscode.WebviewPanel {
@@ -168,6 +174,14 @@ export class InterfaceManager extends DisposableObject {
]
}
));
// this._panel.onDidChangeViewState(
// (e) => {
// this.logger.log(JSON.stringify(e));
// },
// null,
// ctx.subscriptions
// );
this._panel.onDidDispose(
() => {
this._panel = undefined;