Skip to content

Commit c2e0f25

Browse files
committed
Addresses comments on #266
1 parent 2489095 commit c2e0f25

File tree

7 files changed

+11
-10
lines changed

7 files changed

+11
-10
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class CompletedQuery implements QueryWithResults {
6868
return `timed out after ${this.result.evaluationTime / 1000} seconds`;
6969
case messages.QueryResultType.OTHER_ERROR:
7070
default:
71-
return `failed: ${this.result.message || ''}`;
71+
return this.result.message ? `failed: ${this.result.message}` : 'failed';
7272
}
7373
}
7474

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ export async function compileAndRunQueryAgainstDatabase(
423423
errors = await query.compile(qs);
424424
} catch (e) {
425425
if (e instanceof ResponseError && e.code == ErrorCodes.RequestCancelled) {
426-
return createSyntheticResult(query, db, historyItemOptions, 'Query cancelled');
426+
return createSyntheticResult(query, db, historyItemOptions, 'Query cancelled', messages.QueryResultType.CANCELLATION);
427427
} else {
428428
throw e;
429429
}
@@ -469,22 +469,23 @@ export async function compileAndRunQueryAgainstDatabase(
469469
" and choose CodeQL Query Server from the dropdown.");
470470
}
471471

472-
return createSyntheticResult(query, db, historyItemOptions, 'Query had compilation errors');
472+
return createSyntheticResult(query, db, historyItemOptions, 'Query had compilation errors', messages.QueryResultType.OTHER_ERROR);
473473
}
474474
}
475475

476476
function createSyntheticResult(
477477
query: QueryInfo,
478478
db: DatabaseItem,
479479
historyItemOptions: QueryHistoryItemOptions,
480-
message: string
480+
message: string,
481+
resultType: number
481482
) {
482483

483484
return {
484485
query,
485486
result: {
486487
evaluationTime: 0,
487-
resultType: messages.QueryResultType.CANCELLATION,
488+
resultType: resultType,
488489
queryId: -1,
489490
runId: -1,
490491
message

extensions/ql-vscode/src/vscode-tests/index-template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ export function runTestsInDirectory(testsRoot: string): Promise<void> {
5858
}
5959
});
6060
});
61-
}
61+
}

extensions/ql-vscode/src/vscode-tests/minimal-workspace/activation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ describe('launching with a minimal workspace', async () => {
2323
assert(ext!.isActive);
2424
}, 1000);
2525
});
26-
});
26+
});
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import { runTestsInDirectory } from '../index-template';
22
export function run(): Promise<void> {
33
return runTestsInDirectory(__dirname);
4-
}
4+
}

extensions/ql-vscode/src/vscode-tests/no-workspace/activation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ describe('launching with no specified workspace', () => {
1010
it('should not activate the extension at first', () => {
1111
assert(ext!.isActive === false);
1212
});
13-
});
13+
});
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import { runTestsInDirectory } from '../index-template';
22
export function run(): Promise<void> {
33
return runTestsInDirectory(__dirname);
4-
}
4+
}

0 commit comments

Comments
 (0)