Skip to content

Commit a85b7f9

Browse files
authored
Merge pull request #687 from usethesource/fix/end-all-progress-bars
Fix stale evaluation progress bars
2 parents e4be811 + 88fa64f commit a85b7f9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

rascal-lsp/src/main/java/org/rascalmpl/vscode/lsp/util/EvaluatorUtil.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,22 @@ public static <T> InterruptibleFuture<T> runEvaluator(String task, CompletableFu
114114

115115
actualEval.jobStart(task);
116116
synchronized (actualEval) {
117+
boolean jobSuccess = false;
117118
try {
118119
runningEvaluator.set(actualEval);
119120
if (interrupted.get()) {
120121
return defaultResult;
121122
}
122123
T result = call.apply(actualEval);
123-
actualEval.jobEnd(task, true);
124+
jobSuccess = true;
124125
return result;
125126
} catch (InterruptException e) {
126127
// Since the interrupt is not caught by try-catch in Rascal, any jobs started from Rascal with the same name as this task will be 'nested', and might lead to stale progress bars.
127128
// Here, we remove all (nested) jobs.
128129
actualEval.endAllJobs();
129130
return defaultResult;
130131
} finally {
132+
actualEval.jobEnd(task, jobSuccess);
131133
if (monitor instanceof RascalLSPMonitor) {
132134
((RascalLSPMonitor) monitor).unregisterActiveFuture(task);
133135
}

0 commit comments

Comments
 (0)