Skip to content

Commit c5fefa3

Browse files
committed
Avoid opening the results panel on db deletion
Fixes #823
1 parent aa60fbc commit c5fefa3

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

extensions/ql-vscode/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

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

89
## 1.4.5 - 22 March 2021
910

extensions/ql-vscode/src/interface.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,11 @@ export class InterfaceManager extends DisposableObject {
137137
this.databaseManager.onDidChangeDatabaseItem(({ kind }) => {
138138
if (kind === DatabaseEventKind.Remove) {
139139
this._diagnosticCollection.clear();
140-
this.postMessage({
141-
t: 'untoggleShowProblems'
142-
});
140+
if (this.isShowingPanel()) {
141+
this.postMessage({
142+
t: 'untoggleShowProblems'
143+
});
144+
}
143145
}
144146
})
145147
);
@@ -149,6 +151,10 @@ export class InterfaceManager extends DisposableObject {
149151
this.postMessage({ t: 'navigatePath', direction });
150152
}
151153

154+
private isShowingPanel() {
155+
return !!this._panel;
156+
}
157+
152158
// Returns the webview panel, creating it if it doesn't already
153159
// exist.
154160
getPanel(): vscode.WebviewPanel {
@@ -168,6 +174,14 @@ export class InterfaceManager extends DisposableObject {
168174
]
169175
}
170176
));
177+
// this._panel.onDidChangeViewState(
178+
// (e) => {
179+
// this.logger.log(JSON.stringify(e));
180+
// },
181+
// null,
182+
// ctx.subscriptions
183+
// );
184+
171185
this._panel.onDidDispose(
172186
() => {
173187
this._panel = undefined;

0 commit comments

Comments
 (0)