Add link to check detatils while reporting debugging progress (#1034)

This commit is contained in:
Jinbo Wang 2021-07-23 10:39:10 +08:00 committed by GitHub
parent 81f8000bb6
commit 07366c988b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 3 deletions

View File

@ -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

View File

@ -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}...`;

View File

@ -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<boolean> {
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<boolean>((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<boolean>((resolve) => {
progressReporter.getCancellationToken().onCancellationRequested(() => {
resolve(false);