import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import java.util.concurrent.ForkJoinPool;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.Position;
};
private void updateAnnotations() {
- Failable<Module> result = repository.getModule(input.getModuleName(), updateListener);
- if(result instanceof Failure) {
- Failure failure = (Failure)result;
- setAnnotations(Arrays.asList(failure.errors));
- }
- else if(result == DoesNotExist.INSTANCE)
- setAnnotations(Collections.<CompilationError>emptyList());
- else
- setAnnotations(Arrays.asList(result.getResult().getWarnings()));
+ ForkJoinPool.commonPool().submit(() -> {
+ if (!connected)
+ return;
+ Failable<Module> result = repository.getModule(input.getModuleName(), updateListener);
+ if(result instanceof Failure) {
+ Failure failure = (Failure)result;
+ setAnnotations(Arrays.asList(failure.errors));
+ }
+ else if(result == DoesNotExist.INSTANCE)
+ setAnnotations(Collections.<CompilationError>emptyList());
+ else
+ setAnnotations(Arrays.asList(result.getResult().getWarnings()));
+ });
}
protected void setAnnotations(List<CompilationError> errors) {