11import type { CodeQLCliServer } from "../codeql-cli/cli" ;
22import type { Mode } from "./shared/mode" ;
3+ import type { QueryConstraints } from "../local-queries" ;
34import { resolveQueriesFromPacks } from "../local-queries" ;
4- import { modeTag } from "./mode-tag" ;
55import { getOnDiskWorkspaceFolders } from "../common/vscode/workspace-folders" ;
66import type { NotificationLogger } from "../common/logging" ;
77import { showAndLogExceptionWithTelemetry } from "../common/logging" ;
@@ -22,6 +22,7 @@ type RunQueryOptions = {
2222 parseResults : (
2323 results : DecodedBqrsChunk ,
2424 ) => AccessPathSuggestionRow [ ] | Promise < AccessPathSuggestionRow [ ] > ;
25+ queryConstraints : QueryConstraints ;
2526
2627 cliServer : CodeQLCliServer ;
2728 queryRunner : QueryRunner ;
@@ -39,6 +40,7 @@ export async function runSuggestionsQuery(
3940 mode : Mode ,
4041 {
4142 parseResults,
43+ queryConstraints,
4244 cliServer,
4345 queryRunner,
4446 logger,
@@ -68,6 +70,7 @@ export async function runSuggestionsQuery(
6870 cliServer ,
6971 databaseItem . language ,
7072 mode ,
73+ queryConstraints ,
7174 ) ;
7275 if ( ! queryPath ) {
7376 void showAndLogExceptionWithTelemetry (
@@ -141,13 +144,15 @@ export async function runSuggestionsQuery(
141144 * @param cliServer The CodeQL CLI server to use.
142145 * @param language The language of the query pack to use.
143146 * @param mode The mode to resolve the query for.
147+ * @param queryConstraints Constraints to apply to the query.
144148 * @param additionalPackNames Additional pack names to search.
145149 * @param additionalPackPaths Additional pack paths to search.
146150 */
147151async function resolveSuggestionsQuery (
148152 cliServer : CodeQLCliServer ,
149153 language : string ,
150154 mode : Mode ,
155+ queryConstraints : QueryConstraints ,
151156 additionalPackNames : string [ ] = [ ] ,
152157 additionalPackPaths : string [ ] = [ ] ,
153158) : Promise < string | undefined > {
@@ -156,14 +161,7 @@ async function resolveSuggestionsQuery(
156161 const queries = await resolveQueriesFromPacks (
157162 cliServer ,
158163 packsToSearch ,
159- {
160- kind : "table" ,
161- "tags contain all" : [
162- "modeleditor" ,
163- "access-path-suggestions" ,
164- modeTag ( mode ) ,
165- ] ,
166- } ,
164+ queryConstraints ,
167165 additionalPackPaths ,
168166 ) ;
169167 if ( queries . length > 1 ) {
0 commit comments