Skip to content

Commit

Permalink
Make sure the progress report is not empty (#1400)
Browse files Browse the repository at this point in the history
Signed-off-by: Sheng Chen <[email protected]>
  • Loading branch information
jdneo authored Aug 31, 2023
1 parent be9db8f commit a129d2c
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.Date;
import java.util.Objects;

import org.apache.commons.lang3.StringUtils;
import org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin;
import org.eclipse.lsp4j.ExecuteCommandParams;
import org.eclipse.lsp4j.ProgressParams;
Expand Down Expand Up @@ -105,7 +106,8 @@ public void onBuildTaskProgress(TaskProgressParams params) {
} else {
Either<String, Integer> id = Either.forLeft(params.getTaskId().getId());
WorkDoneProgressReport workDoneProgressReport = new WorkDoneProgressReport();
workDoneProgressReport.setMessage(BUILD_SERVER_TASK + " - " + params.getMessage());
workDoneProgressReport.setMessage(StringUtils.isBlank(params.getMessage()) ? BUILD_SERVER_TASK :
BUILD_SERVER_TASK + " - " + params.getMessage());
lsClient.notifyProgress(new ProgressParams(id, Either.forLeft(workDoneProgressReport)));
}
}
Expand All @@ -118,7 +120,8 @@ public void onBuildTaskFinish(TaskFinishParams params) {
} else {
Either<String, Integer> id = Either.forLeft(params.getTaskId().getId());
WorkDoneProgressEnd workDoneProgressEnd = new WorkDoneProgressEnd();
workDoneProgressEnd.setMessage(params.getMessage());
workDoneProgressEnd.setMessage(StringUtils.isBlank(params.getMessage()) ? BUILD_SERVER_TASK :
BUILD_SERVER_TASK + " - " + params.getMessage());
lsClient.notifyProgress(new ProgressParams(id, Either.forLeft(workDoneProgressEnd)));
}
}
Expand Down

0 comments on commit a129d2c

Please sign in to comment.