More unnecessary awaits
This commit is contained in:
@@ -28,7 +28,7 @@ async function lintScenarios() {
|
||||
throw new Error(`Invalid schema: ${ajv.errorsText()}`);
|
||||
}
|
||||
|
||||
const validate = await ajv.compile(schema);
|
||||
const validate = ajv.compile(schema);
|
||||
|
||||
let invalidFiles = 0;
|
||||
|
||||
|
||||
@@ -295,7 +295,7 @@ export class CodeQLCliServer implements Disposable {
|
||||
);
|
||||
}
|
||||
|
||||
return await spawnServer(
|
||||
return spawnServer(
|
||||
codeQlPath,
|
||||
"CodeQL CLI Server",
|
||||
["execute", "cli-server"],
|
||||
@@ -455,7 +455,7 @@ export class CodeQLCliServer implements Disposable {
|
||||
void logStream(child.stderr!, logger);
|
||||
}
|
||||
|
||||
for await (const event of await splitStreamAtSeparators(child.stdout!, [
|
||||
for await (const event of splitStreamAtSeparators(child.stdout!, [
|
||||
"\0",
|
||||
])) {
|
||||
yield event;
|
||||
@@ -487,7 +487,7 @@ export class CodeQLCliServer implements Disposable {
|
||||
cancellationToken?: CancellationToken,
|
||||
logger?: Logger,
|
||||
): AsyncGenerator<EventType, void, unknown> {
|
||||
for await (const event of await this.runAsyncCodeQlCliCommandInternal(
|
||||
for await (const event of this.runAsyncCodeQlCliCommandInternal(
|
||||
command,
|
||||
commandArgs,
|
||||
cancellationToken,
|
||||
@@ -750,7 +750,7 @@ export class CodeQLCliServer implements Disposable {
|
||||
...testPaths,
|
||||
]);
|
||||
|
||||
for await (const event of await this.runAsyncCodeQlCliCommand<TestCompleted>(
|
||||
for await (const event of this.runAsyncCodeQlCliCommand<TestCompleted>(
|
||||
["test", "run"],
|
||||
subcommandArgs,
|
||||
"Run CodeQL Tests",
|
||||
@@ -1543,7 +1543,7 @@ const lineEndings = ["\r\n", "\r", "\n"];
|
||||
* @param logger The logger that will consume the stream output.
|
||||
*/
|
||||
async function logStream(stream: Readable, logger: Logger): Promise<void> {
|
||||
for await (const line of await splitStreamAtSeparators(stream, lineEndings)) {
|
||||
for await (const line of splitStreamAtSeparators(stream, lineEndings)) {
|
||||
// Await the result of log here in order to ensure the logs are written in the correct order.
|
||||
await logger.log(line);
|
||||
}
|
||||
|
||||
@@ -96,8 +96,8 @@ export class MockGitHubApiServer extends DisposableObject {
|
||||
}
|
||||
|
||||
public async stopRecording(): Promise<void> {
|
||||
await this.recorder.stop();
|
||||
await this.recorder.clear();
|
||||
this.recorder.stop();
|
||||
this.recorder.clear();
|
||||
}
|
||||
|
||||
public async getScenarioNames(scenariosPath?: string): Promise<string[]> {
|
||||
|
||||
@@ -35,11 +35,11 @@ export class VSCodeMockGitHubApiServer extends DisposableObject {
|
||||
}
|
||||
|
||||
public async startServer(): Promise<void> {
|
||||
await this.server.startServer();
|
||||
this.server.startServer();
|
||||
}
|
||||
|
||||
public async stopServer(): Promise<void> {
|
||||
await this.server.stopServer();
|
||||
this.server.stopServer();
|
||||
|
||||
await commands.executeCommand(
|
||||
"setContext",
|
||||
|
||||
@@ -356,15 +356,11 @@ export class QLTestAdapter extends DisposableObject implements TestAdapter {
|
||||
tests: string[],
|
||||
cancellationToken: CancellationToken,
|
||||
): Promise<void> {
|
||||
const workspacePaths = await getOnDiskWorkspaceFolders();
|
||||
for await (const event of await this.cliServer.runTests(
|
||||
tests,
|
||||
workspacePaths,
|
||||
{
|
||||
cancellationToken,
|
||||
logger: testLogger,
|
||||
},
|
||||
)) {
|
||||
const workspacePaths = getOnDiskWorkspaceFolders();
|
||||
for await (const event of this.cliServer.runTests(tests, workspacePaths, {
|
||||
cancellationToken,
|
||||
logger: testLogger,
|
||||
})) {
|
||||
const state = event.pass
|
||||
? "passed"
|
||||
: event.messages?.length
|
||||
|
||||
@@ -50,11 +50,11 @@ class Checkpoint<T> {
|
||||
}
|
||||
|
||||
async resolve(): Promise<void> {
|
||||
await this.res();
|
||||
this.res();
|
||||
}
|
||||
|
||||
async reject(e: Error): Promise<void> {
|
||||
await this.rej(e);
|
||||
this.rej(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,11 +50,11 @@ class Checkpoint<T> {
|
||||
}
|
||||
|
||||
async resolve(): Promise<void> {
|
||||
await this.res();
|
||||
this.res();
|
||||
}
|
||||
|
||||
async reject(e: Error): Promise<void> {
|
||||
await this.rej(e);
|
||||
this.rej(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user