diff --git a/src/progressAPI.ts b/src/progressAPI.ts index 02b12f1..379069b 100644 --- a/src/progressAPI.ts +++ b/src/progressAPI.ts @@ -9,6 +9,11 @@ export interface IProgressReporter { */ getId(): string; + /** + * Returns the progress location. + */ + getProgressLocation(): ProgressLocation | { viewId: string }; + /** * Reports a progress message update. * @param message the message to update diff --git a/src/progressImpl.ts b/src/progressImpl.ts index 954cce9..9e7c83a 100644 --- a/src/progressImpl.ts +++ b/src/progressImpl.ts @@ -55,6 +55,10 @@ class ProgressReporter implements IProgressReporter { return this._id; } + public getProgressLocation(): ProgressLocation | { viewId: string } { + return this._progressLocation; + } + public report(message: string, increment?: number): void { if (this._statusBarItem) { const text = message ? `${this._jobName} - ${message}` : `${this._jobName}...`; diff --git a/src/utility.ts b/src/utility.ts index 29f1994..aa9b82c 100644 --- a/src/utility.ts +++ b/src/utility.ts @@ -229,8 +229,10 @@ export enum ServerMode { * and return true if the final status is on Standard mode. */ export async function waitForStandardMode(progressReporter: IProgressReporter): Promise { + const importMessage = progressReporter?.getProgressLocation() === vscode.ProgressLocation.Notification ? + "Importing projects, [check details](command:java.show.server.task.status)" : "Importing projects..."; if (await isImportingProjects()) { - progressReporter.report("Importing projects..."); + progressReporter.report(importMessage); } const api = await getJavaExtensionAPI(progressReporter); @@ -246,7 +248,7 @@ export async function waitForStandardMode(progressReporter: IProgressReporter): return true; } - progressReporter?.report("Importing projects..."); + progressReporter?.report(importMessage); return new Promise((resolve) => { progressReporter.getCancellationToken().onCancellationRequested(() => { resolve(false); @@ -263,7 +265,7 @@ export async function waitForStandardMode(progressReporter: IProgressReporter): return false; } else if (api && api.serverMode === ServerMode.HYBRID) { - progressReporter.report("Importing projects..."); + progressReporter.report(importMessage); return new Promise((resolve) => { progressReporter.getCancellationToken().onCancellationRequested(() => { resolve(false);