Skip to content

Commit a6cd08f

Browse files
committed
Add wrapper for 'resolve queries' cli command
1 parent 881c909 commit a6cd08f

File tree

1 file changed

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

1 file changed

+20
-0
lines changed

extensions/ql-vscode/src/cli.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,26 @@ export class CodeQLCliServer implements Disposable {
614614
"Resolving qlpack information",
615615
);
616616
}
617+
618+
/**
619+
* Gets information about queries in a query suite.
620+
* @param additionalPacks A list of directories to search for qlpacks before searching in `searchPath`.
621+
* @param searchPath A list of directories to search for packs not found in `additionalPacks`. If undefined,
622+
* the default CLI search path is used.
623+
* @returns A list of query files found
624+
*/
625+
resolveQueriesInSuite(suite: string, additionalPacks: string[], searchPath?: string[]): Promise<string[]> {
626+
const args = ['--additional-packs', additionalPacks.join(path.delimiter)];
627+
if (searchPath !== undefined) {
628+
args.push('--search-path', path.join(...searchPath));
629+
}
630+
args.push(suite);
631+
return this.runJsonCodeQlCliCommand<string[]>(
632+
['resolve', 'queries'],
633+
args,
634+
"Resolving queries",
635+
);
636+
}
617637
}
618638

619639
/**

0 commit comments

Comments
 (0)