Skip to content

Commit d0e0ad6

Browse files
authored
Merge pull request #511 from ceh-forks/ceh-skip-log
Suppress database downloaded message when action canceled
2 parents 9052851 + e4ff8d1 commit d0e0ad6

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

extensions/ql-vscode/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Fix error with choosing qlpack search path.
77
- Add the AST Viewer to inspect the QL AST of a source file in a database. Currently, only available for C/C++ sources.
88
- Fix pagination when there are no results.
9+
- Suppress database downloaded from URL message when action canceled.
910

1011
## 1.3.1 - 7 July 2020
1112

extensions/ql-vscode/src/databaseFetcher.ts

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ export async function promptImportInternetDatabase(
5454
progress
5555
))
5656
);
57-
commands.executeCommand('codeQLDatabases.focus');
57+
if (item) {
58+
commands.executeCommand('codeQLDatabases.focus');
59+
showAndLogInformationMessage('Database downloaded and imported successfully.');
60+
}
5861
}
59-
showAndLogInformationMessage(
60-
'Database downloaded and imported successfully.'
61-
);
6262
} catch (e) {
6363
showAndLogErrorMessage(e.message);
6464
}
@@ -106,16 +106,14 @@ export async function promptImportLgtmDatabase(
106106
progress
107107
))
108108
);
109-
commands.executeCommand('codeQLDatabases.focus');
109+
if (item) {
110+
commands.executeCommand('codeQLDatabases.focus');
111+
showAndLogInformationMessage('Database downloaded and imported successfully.');
112+
}
110113
}
111114
} else {
112115
throw new Error(`Invalid LGTM URL: ${lgtmUrl}`);
113116
}
114-
if (item) {
115-
showAndLogInformationMessage(
116-
'Database downloaded and imported successfully.'
117-
);
118-
}
119117
} catch (e) {
120118
showAndLogErrorMessage(e.message);
121119
}
@@ -152,12 +150,9 @@ export async function importArchiveDatabase(
152150
progress
153151
))
154152
);
155-
commands.executeCommand('codeQLDatabases.focus');
156-
157153
if (item) {
158-
showAndLogInformationMessage(
159-
'Database unzipped and imported successfully.'
160-
);
154+
commands.executeCommand('codeQLDatabases.focus');
155+
showAndLogInformationMessage('Database unzipped and imported successfully.');
161156
}
162157
} catch (e) {
163158
if (e.message.includes('unexpected end of file')) {

0 commit comments

Comments
 (0)