Skip to content

Commit 07366c9

Browse files
Add link to check detatils while reporting debugging progress (#1034)
1 parent 81f8000 commit 07366c9

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

src/progressAPI.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ export interface IProgressReporter {
99
*/
1010
getId(): string;
1111

12+
/**
13+
* Returns the progress location.
14+
*/
15+
getProgressLocation(): ProgressLocation | { viewId: string };
16+
1217
/**
1318
* Reports a progress message update.
1419
* @param message the message to update

src/progressImpl.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ class ProgressReporter implements IProgressReporter {
5555
return this._id;
5656
}
5757

58+
public getProgressLocation(): ProgressLocation | { viewId: string } {
59+
return this._progressLocation;
60+
}
61+
5862
public report(message: string, increment?: number): void {
5963
if (this._statusBarItem) {
6064
const text = message ? `${this._jobName} - ${message}` : `${this._jobName}...`;

src/utility.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,10 @@ export enum ServerMode {
229229
* and return true if the final status is on Standard mode.
230230
*/
231231
export async function waitForStandardMode(progressReporter: IProgressReporter): Promise<boolean> {
232+
const importMessage = progressReporter?.getProgressLocation() === vscode.ProgressLocation.Notification ?
233+
"Importing projects, [check details](command:java.show.server.task.status)" : "Importing projects...";
232234
if (await isImportingProjects()) {
233-
progressReporter.report("Importing projects...");
235+
progressReporter.report(importMessage);
234236
}
235237

236238
const api = await getJavaExtensionAPI(progressReporter);
@@ -246,7 +248,7 @@ export async function waitForStandardMode(progressReporter: IProgressReporter):
246248
return true;
247249
}
248250

249-
progressReporter?.report("Importing projects...");
251+
progressReporter?.report(importMessage);
250252
return new Promise<boolean>((resolve) => {
251253
progressReporter.getCancellationToken().onCancellationRequested(() => {
252254
resolve(false);
@@ -263,7 +265,7 @@ export async function waitForStandardMode(progressReporter: IProgressReporter):
263265

264266
return false;
265267
} else if (api && api.serverMode === ServerMode.HYBRID) {
266-
progressReporter.report("Importing projects...");
268+
progressReporter.report(importMessage);
267269
return new Promise<boolean>((resolve) => {
268270
progressReporter.getCancellationToken().onCancellationRequested(() => {
269271
resolve(false);

0 commit comments

Comments
 (0)