Skip to content

Commit 2171ec1

Browse files
Include cliServer.resolveQlpacks in the progress notification so there isn't a gap with no updates
1 parent 8407516 commit 2171ec1

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

extensions/ql-vscode/src/model-editor/external-api-usage-queries.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export async function prepareExternalApiQuery(
5858
return true;
5959
}
6060

61-
export const externalApiQueriesProgressMaxStep = 1500;
61+
export const externalApiQueriesProgressMaxStep = 2000;
6262

6363
export async function runExternalApiQueries(
6464
mode: Mode,
@@ -78,6 +78,11 @@ export async function runExternalApiQueries(
7878
// For a reference of what this should do in the future, see the previous implementation in
7979
// https://github.com/github/vscode-codeql/blob/089d3566ef0bc67d9b7cc66e8fd6740b31c1c0b0/extensions/ql-vscode/src/data-extensions-editor/external-api-usage-query.ts#L33-L72
8080

81+
progress({
82+
message: "Resolving QL packs",
83+
step: 1,
84+
maxStep: externalApiQueriesProgressMaxStep,
85+
});
8186
const additionalPacks = getOnDiskWorkspaceFolders();
8287
const extensionPacks = Object.keys(
8388
await cliServer.resolveQlpacks(additionalPacks, true),
@@ -95,7 +100,11 @@ export async function runExternalApiQueries(
95100
additionalPacks,
96101
extensionPacks,
97102
progress: (update) =>
98-
progress({ ...update, maxStep: externalApiQueriesProgressMaxStep }),
103+
progress({
104+
step: update.step + 500,
105+
maxStep: externalApiQueriesProgressMaxStep,
106+
message: update.message,
107+
}),
99108
token,
100109
// We need to create a lock file, because the query is inside our own pack
101110
createLockFile: true,
@@ -108,7 +117,7 @@ export async function runExternalApiQueries(
108117
// Read the results and covert to internal representation
109118
progress({
110119
message: "Decoding results",
111-
step: 1100,
120+
step: 1600,
112121
maxStep: externalApiQueriesProgressMaxStep,
113122
});
114123

@@ -122,7 +131,7 @@ export async function runExternalApiQueries(
122131

123132
progress({
124133
message: "Finalizing results",
125-
step: 1450,
134+
step: 1950,
126135
maxStep: externalApiQueriesProgressMaxStep,
127136
});
128137

0 commit comments

Comments
 (0)