Skip to content

Commit c44b7b1

Browse files
committed
Apply suggestions from code review
1 parent 24ede1b commit c44b7b1

6 files changed

Lines changed: 8 additions & 12 deletions

File tree

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,6 @@ export class DatabaseUI extends DisposableObject {
393393
await this.chooseAndSetDatabase(true, progress, token);
394394
} catch (e) {
395395
void showAndLogErrorMessage(getErrorMessage(e));
396-
return undefined;
397396
}
398397
};
399398

@@ -461,7 +460,6 @@ export class DatabaseUI extends DisposableObject {
461460
await this.chooseAndSetDatabase(false, progress, token);
462461
} catch (e) {
463462
void showAndLogErrorMessage(getErrorMessage(e));
464-
return undefined;
465463
}
466464
};
467465

extensions/ql-vscode/src/json-rpc-server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ export class ServerProcess implements Disposable {
1010
connection: MessageConnection;
1111
logger: Logger;
1212

13-
constructor(child: cp.ChildProcess, connection: MessageConnection, logger: Logger) {
13+
constructor(child: cp.ChildProcess, connection: MessageConnection, private name: string, logger: Logger) {
1414
this.child = child;
1515
this.connection = connection;
1616
this.logger = logger;
1717
}
1818

1919
dispose(): void {
20-
void this.logger.log('Stopping query server...');
20+
void this.logger.log(`Stopping ${this.name}...`);
2121
this.connection.dispose();
2222
this.child.stdin!.end();
2323
this.child.stderr!.destroy();
2424
// TODO kill the process if it doesn't terminate after a certain time limit.
2525

2626
// On Windows, we usually have to terminate the process before closing its stdout.
2727
this.child.stdout!.destroy();
28-
void this.logger.log('Stopped query server.');
28+
void this.logger.log(`Stopped ${this.name}.`);
2929
}
3030
}

extensions/ql-vscode/src/legacy-query-server/queryserver-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export class QueryServerClient extends DisposableObject {
176176
callback(res);
177177
}
178178
});
179-
this.serverProcess = new ServerProcess(child, connection, this.logger);
179+
this.serverProcess = new ServerProcess(child, connection, 'Query server', this.logger);
180180
// Ensure the server process is disposed together with this client.
181181
this.track(this.serverProcess);
182182
connection.listen();

extensions/ql-vscode/src/legacy-query-server/run-queries.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class QueryInProgress {
3737

3838
public queryEvalInfo: QueryEvaluationInfo;
3939
/**
40-
* Note that in the {@link FullQueryInfo.slurp} method, we create a QueryEvaluationInfo instance
40+
* Note that in the {@link slurpQueryHistory} method, we create a QueryEvaluationInfo instance
4141
* by explicitly setting the prototype in order to avoid calling this constructor.
4242
*/
4343
constructor(
@@ -515,4 +515,3 @@ function createSimpleTemplates(templates: Record<string, string> | undefined): m
515515
}
516516
return result;
517517
}
518-

extensions/ql-vscode/src/query-results.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export class CompletedQueryInfo implements QueryWithResults {
7575
interpretedResultsSortState: InterpretedResultsSortState | undefined;
7676

7777
/**
78-
* Note that in the {@link FullQueryInfo.slurp} method, we create a CompletedQueryInfo instance
78+
* Note that in the {@link slurpQueryHistory} method, we create a CompletedQueryInfo instance
7979
* by explicitly setting the prototype in order to avoid calling this constructor.
8080
*/
8181
constructor(

extensions/ql-vscode/src/run-queries-shared.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function findQueryEvalLogEndSummaryFile(resultPath: string): string {
6262
export class QueryEvaluationInfo {
6363

6464
/**
65-
* Note that in the {@link FullQueryInfo.slurp} method, we create a QueryEvaluationInfo instance
65+
* Note that in the {@link slurpQueryHistory} method, we create a QueryEvaluationInfo instance
6666
* by explicitly setting the prototype in order to avoid calling this constructor.
6767
*/
6868
constructor(
@@ -213,7 +213,7 @@ export class QueryEvaluationInfo {
213213
async addQueryLogs(queryInfo: LocalQueryInfo, cliServer: CodeQLCliServer, logger: Logger) {
214214
queryInfo.evalLogLocation = this.evalLogPath;
215215
queryInfo.evalLogSummaryLocation = await this.generateHumanReadableLogSummary(cliServer);
216-
void this.logEndSummary(queryInfo.evalLogSummaryLocation, logger); // Logged asynchrnously
216+
void this.logEndSummary(queryInfo.evalLogSummaryLocation, logger); // Logged asynchrnously
217217
if (config.isCanary()) { // Generate JSON summary for viewer.
218218
await cliServer.generateJsonLogSummary(this.evalLogPath, this.jsonEvalLogSummaryPath);
219219
queryInfo.jsonEvalLogSummaryLocation = this.jsonEvalLogSummaryPath;
@@ -582,4 +582,3 @@ export async function createInitialQueryInfo(
582582
})
583583
};
584584
}
585-

0 commit comments

Comments
 (0)