Skip to content

Commit b6c7837

Browse files
committed
Pluralize registration message names
And do a version check before adding `--require-db-registration` flag.
1 parent d76f912 commit b6c7837

4 files changed

Lines changed: 13 additions & 12 deletions

File tree

extensions/ql-vscode/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## [UNRELEASED]
44

5-
- Ensure databases are unlocked when removing them from the workspace. This will ensure that queries can be run on a database from the command line after being removed. Requires CodeQL CLI 2.4.1 or later. [#681](https://github.com/github/vscode-codeql/pull/681)
5+
- Ensure databases are unlocked when removing them from the workspace. This will ensure that after a database is removed from VS Code, queries can be run on it from the command line without restarting VS Code. Requires CodeQL CLI 2.4.1 or later. [#681](https://github.com/github/vscode-codeql/pull/681)
66
- Fix bug when removing databases where sometimes the source folder would not be removed from the workspace or the database files would not be removed from the workspace storage location. [#692](https://github.com/github/vscode-codeql/pull/692)
77
- Query results with no string representation will now be displayed with placeholder text in query results. Previously, they were omitted. [#694](https://github.com/github/vscode-codeql/pull/694)
88

extensions/ql-vscode/src/databases-ui.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ export class DatabaseUI extends DisposableObject {
603603
multiSelect: DatabaseItem[] | undefined
604604
): Promise<void> => {
605605
if (multiSelect?.length) {
606-
Promise.all(multiSelect.map((dbItem) =>
606+
await Promise.all(multiSelect.map((dbItem) =>
607607
this.databaseManager.removeDatabaseItem(progress, token, dbItem)
608608
));
609609
} else {

extensions/ql-vscode/src/pure/messages.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -861,19 +861,19 @@ export interface RunUpgradeResult {
861861
finalSha: string;
862862
}
863863

864-
export interface RegisterDatabaseParams {
864+
export interface RegisterDatabasesParams {
865865
databases: Dataset[];
866866
}
867867

868-
export interface DeregisterDatabaseParams {
868+
export interface DeregisterDatabasesParams {
869869
databases: Dataset[];
870870
}
871871

872-
export type RegisterDatabaseResult = {
872+
export type RegisterDatabasesResult = {
873873
registeredDatabases: Dataset[];
874874
};
875875

876-
export type DeregisterDatabaseResult = {
876+
export type DeregisterDatabasesResult = {
877877
registeredDatabases: Dataset[];
878878
};
879879

@@ -954,15 +954,15 @@ export const runQueries = new rpc.RequestType<WithProgressId<EvaluateQueriesPara
954954
export const runUpgrade = new rpc.RequestType<WithProgressId<RunUpgradeParams>, RunUpgradeResult, void, void>('evaluation/runUpgrade');
955955

956956
export const registerDatabases = new rpc.RequestType<
957-
WithProgressId<RegisterDatabaseParams>,
958-
RegisterDatabaseResult,
957+
WithProgressId<RegisterDatabasesParams>,
958+
RegisterDatabasesResult,
959959
void,
960960
void
961961
>('evaluation/registerDatabases');
962962

963963
export const deregisterDatabases = new rpc.RequestType<
964-
WithProgressId<DeregisterDatabaseParams>,
965-
DeregisterDatabaseResult,
964+
WithProgressId<DeregisterDatabasesParams>,
965+
DeregisterDatabasesResult,
966966
void,
967967
void
968968
>('evaluation/deregisterDatabases');

extensions/ql-vscode/src/queryserver-client.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@ export class QueryServerClient extends DisposableObject {
112112
const ramArgs = await this.cliServer.resolveRam(this.config.queryMemoryMb, progressReporter);
113113
const args = ['--threads', this.config.numThreads.toString()].concat(ramArgs);
114114

115-
// TODO: This should only be added after an appropriate version check
116-
args.push('--require-db-registration');
115+
if (await this.supportsDatabaseRegistration()) {
116+
args.push('--require-db-registration');
117+
}
117118

118119
if (this.config.debug) {
119120
args.push('--debug', '--tuple-counting');

0 commit comments

Comments
 (0)