Skip to content

Commit 3a3d0f4

Browse files
committed
Add cli endpoint for resolve qlpacks
1 parent d69d7dc commit 3a3d0f4

File tree

1 file changed

+20
-1
lines changed
  • extensions/ql-vscode/src

1 file changed

+20
-1
lines changed

extensions/ql-vscode/src/cli.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ export interface UpgradesInfo {
5050
finalDbscheme: string;
5151
}
5252

53+
/**
54+
* The expected output of `codeql resolve qlpacks`.
55+
*/
56+
export type QlpacksInfo = { [name: string]: string[] };
57+
5358
/**
5459
* The expected output of `codeql resolve metadata`.
5560
*/
@@ -396,7 +401,6 @@ export class CodeQLCliServer implements Disposable {
396401
"Resolving database");
397402
}
398403

399-
400404
/**
401405
* Gets information necessary for upgrading a database.
402406
* @param dbScheme the path to the dbscheme of the database to be upgraded.
@@ -412,6 +416,21 @@ export class CodeQLCliServer implements Disposable {
412416
"Resolving database upgrade scripts",
413417
);
414418
}
419+
420+
/**
421+
* Gets information about available qlpacks
422+
* @param searchPath A list of directories to search for qlpacks
423+
* @returns A dictionary mapping qlpack name to the directory it comes from
424+
*/
425+
resolveQlpacks(searchPath: string[]): Promise<QlpacksInfo> {
426+
const args = ['--additional-packs', searchPath.join(path.delimiter)];
427+
428+
return this.runJsonCodeQlCliCommand<QlpacksInfo>(
429+
['resolve', 'qlpacks'],
430+
args,
431+
"Resolving qlpack information",
432+
);
433+
}
415434
}
416435

417436
/**

0 commit comments

Comments
 (0)