Add link to check detatils while reporting debugging progress (#1034)
This commit is contained in:
parent
81f8000bb6
commit
07366c988b
|
@ -9,6 +9,11 @@ export interface IProgressReporter {
|
||||||
*/
|
*/
|
||||||
getId(): string;
|
getId(): string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the progress location.
|
||||||
|
*/
|
||||||
|
getProgressLocation(): ProgressLocation | { viewId: string };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reports a progress message update.
|
* Reports a progress message update.
|
||||||
* @param message the message to update
|
* @param message the message to update
|
||||||
|
|
|
@ -55,6 +55,10 @@ class ProgressReporter implements IProgressReporter {
|
||||||
return this._id;
|
return this._id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getProgressLocation(): ProgressLocation | { viewId: string } {
|
||||||
|
return this._progressLocation;
|
||||||
|
}
|
||||||
|
|
||||||
public report(message: string, increment?: number): void {
|
public report(message: string, increment?: number): void {
|
||||||
if (this._statusBarItem) {
|
if (this._statusBarItem) {
|
||||||
const text = message ? `${this._jobName} - ${message}` : `${this._jobName}...`;
|
const text = message ? `${this._jobName} - ${message}` : `${this._jobName}...`;
|
||||||
|
|
|
@ -229,8 +229,10 @@ export enum ServerMode {
|
||||||
* and return true if the final status is on Standard mode.
|
* and return true if the final status is on Standard mode.
|
||||||
*/
|
*/
|
||||||
export async function waitForStandardMode(progressReporter: IProgressReporter): Promise<boolean> {
|
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()) {
|
if (await isImportingProjects()) {
|
||||||
progressReporter.report("Importing projects...");
|
progressReporter.report(importMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
const api = await getJavaExtensionAPI(progressReporter);
|
const api = await getJavaExtensionAPI(progressReporter);
|
||||||
|
@ -246,7 +248,7 @@ export async function waitForStandardMode(progressReporter: IProgressReporter):
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
progressReporter?.report("Importing projects...");
|
progressReporter?.report(importMessage);
|
||||||
return new Promise<boolean>((resolve) => {
|
return new Promise<boolean>((resolve) => {
|
||||||
progressReporter.getCancellationToken().onCancellationRequested(() => {
|
progressReporter.getCancellationToken().onCancellationRequested(() => {
|
||||||
resolve(false);
|
resolve(false);
|
||||||
|
@ -263,7 +265,7 @@ export async function waitForStandardMode(progressReporter: IProgressReporter):
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} else if (api && api.serverMode === ServerMode.HYBRID) {
|
} else if (api && api.serverMode === ServerMode.HYBRID) {
|
||||||
progressReporter.report("Importing projects...");
|
progressReporter.report(importMessage);
|
||||||
return new Promise<boolean>((resolve) => {
|
return new Promise<boolean>((resolve) => {
|
||||||
progressReporter.getCancellationToken().onCancellationRequested(() => {
|
progressReporter.getCancellationToken().onCancellationRequested(() => {
|
||||||
resolve(false);
|
resolve(false);
|
||||||
|
|
Loading…
Reference in New Issue