Skip to content

Commit

Permalink
Pluralize registration message names
Browse files Browse the repository at this point in the history
And do a version check before adding `--require-db-registration` flag.
  • Loading branch information
aeisenberg committed Dec 2, 2020
1 parent d76f912 commit b6c7837
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion extensions/ql-vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## [UNRELEASED]

- 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)
- 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)
- 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)
- 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)

Expand Down
2 changes: 1 addition & 1 deletion extensions/ql-vscode/src/databases-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ export class DatabaseUI extends DisposableObject {
multiSelect: DatabaseItem[] | undefined
): Promise<void> => {
if (multiSelect?.length) {
Promise.all(multiSelect.map((dbItem) =>
await Promise.all(multiSelect.map((dbItem) =>
this.databaseManager.removeDatabaseItem(progress, token, dbItem)
));
} else {
Expand Down
16 changes: 8 additions & 8 deletions extensions/ql-vscode/src/pure/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -861,19 +861,19 @@ export interface RunUpgradeResult {
finalSha: string;
}

export interface RegisterDatabaseParams {
export interface RegisterDatabasesParams {
databases: Dataset[];
}

export interface DeregisterDatabaseParams {
export interface DeregisterDatabasesParams {
databases: Dataset[];
}

export type RegisterDatabaseResult = {
export type RegisterDatabasesResult = {
registeredDatabases: Dataset[];
};

export type DeregisterDatabaseResult = {
export type DeregisterDatabasesResult = {
registeredDatabases: Dataset[];
};

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

export const registerDatabases = new rpc.RequestType<
WithProgressId<RegisterDatabaseParams>,
RegisterDatabaseResult,
WithProgressId<RegisterDatabasesParams>,
RegisterDatabasesResult,
void,
void
>('evaluation/registerDatabases');

export const deregisterDatabases = new rpc.RequestType<
WithProgressId<DeregisterDatabaseParams>,
DeregisterDatabaseResult,
WithProgressId<DeregisterDatabasesParams>,
DeregisterDatabasesResult,
void,
void
>('evaluation/deregisterDatabases');
Expand Down
5 changes: 3 additions & 2 deletions extensions/ql-vscode/src/queryserver-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ export class QueryServerClient extends DisposableObject {
const ramArgs = await this.cliServer.resolveRam(this.config.queryMemoryMb, progressReporter);
const args = ['--threads', this.config.numThreads.toString()].concat(ramArgs);

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

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

0 comments on commit b6c7837

Please sign in to comment.