Skip to content

Commit 439cfcc

Browse files
committed
Remove getResultSetSchema function
1 parent 297f5a9 commit 439cfcc

2 files changed

Lines changed: 3 additions & 13 deletions

File tree

extensions/ql-vscode/src/common/bqrs-cli-types.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,6 @@ export interface ResultSetSchema {
3333
pagination?: PaginationInfo;
3434
}
3535

36-
export function getResultSetSchema(
37-
resultSetName: string,
38-
resultSets: BQRSInfo,
39-
): ResultSetSchema | undefined {
40-
for (const schema of resultSets["result-sets"]) {
41-
if (schema.name === resultSetName) {
42-
return schema;
43-
}
44-
}
45-
return undefined;
46-
}
4736
interface PaginationInfo {
4837
"step-size": number;
4938
offsets: number[];

extensions/ql-vscode/src/language-support/contextual/location-finder.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
import {
66
ColumnKindCode,
77
EntityValue,
8-
getResultSetSchema,
98
ResultSetSchema,
109
} from "../../common/bqrs-cli-types";
1110
import { CodeQLCliServer } from "../../codeql-cli/cli";
@@ -99,7 +98,9 @@ async function getLinksFromResults(
9998
const localLinks: FullLocationLink[] = [];
10099
const bqrsPath = outputDir.bqrsPath;
101100
const info = await cli.bqrsInfo(bqrsPath);
102-
const selectInfo = getResultSetSchema(SELECT_QUERY_NAME, info);
101+
const selectInfo = info["result-sets"].find(
102+
(schema) => schema.name === SELECT_QUERY_NAME,
103+
);
103104
if (isValidSelect(selectInfo)) {
104105
// TODO: Page this
105106
const allTuples = await cli.bqrsDecode(bqrsPath, SELECT_QUERY_NAME);

0 commit comments

Comments
 (0)