Include cliServer.resolveQlpacks in the progress notification so there isn't a gap with no updates

This commit is contained in:
Robert
2023-09-05 16:48:25 +01:00
parent 8407516b31
commit 2171ec1a03

View File

@@ -58,7 +58,7 @@ export async function prepareExternalApiQuery(
return true;
}
export const externalApiQueriesProgressMaxStep = 1500;
export const externalApiQueriesProgressMaxStep = 2000;
export async function runExternalApiQueries(
mode: Mode,
@@ -78,6 +78,11 @@ export async function runExternalApiQueries(
// For a reference of what this should do in the future, see the previous implementation in
// https://github.com/github/vscode-codeql/blob/089d3566ef0bc67d9b7cc66e8fd6740b31c1c0b0/extensions/ql-vscode/src/data-extensions-editor/external-api-usage-query.ts#L33-L72
progress({
message: "Resolving QL packs",
step: 1,
maxStep: externalApiQueriesProgressMaxStep,
});
const additionalPacks = getOnDiskWorkspaceFolders();
const extensionPacks = Object.keys(
await cliServer.resolveQlpacks(additionalPacks, true),
@@ -95,7 +100,11 @@ export async function runExternalApiQueries(
additionalPacks,
extensionPacks,
progress: (update) =>
progress({ ...update, maxStep: externalApiQueriesProgressMaxStep }),
progress({
step: update.step + 500,
maxStep: externalApiQueriesProgressMaxStep,
message: update.message,
}),
token,
// We need to create a lock file, because the query is inside our own pack
createLockFile: true,
@@ -108,7 +117,7 @@ export async function runExternalApiQueries(
// Read the results and covert to internal representation
progress({
message: "Decoding results",
step: 1100,
step: 1600,
maxStep: externalApiQueriesProgressMaxStep,
});
@@ -122,7 +131,7 @@ export async function runExternalApiQueries(
progress({
message: "Finalizing results",
step: 1450,
step: 1950,
maxStep: externalApiQueriesProgressMaxStep,
});