import java.util.Arrays;
import java.util.List;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.Position;
import org.eclipse.jface.text.source.Annotation;
@Override
public void execute(String result) {
if (connected && result != null)
- updateAnnotations(result);
+ scheduleUpdateAnnotations(result);
}
@Override
public void exception(Throwable t) {
public void print(String text) {}
};
+ private void scheduleUpdateAnnotations(String sourceText) {
+ //LOGGER.debug("scheduleUpdateAnnotations:\n" + sourceText);
+ Job validateJob = new Job("Validate Script") {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ updateAnnotations(sourceText);
+ return Status.OK_STATUS;
+ }
+ };
+ validateJob.setPriority(Job.BUILD);
+ validateJob.setUser(false);
+ validateJob.setSystem(false);
+ validateJob.schedule();
+ }
+
private void updateAnnotations(String sourceText) {
//LOGGER.debug("updateAnnotations:\n" + sourceText);
CompilationError[] errors = new CommandSession(repository, NOP).validate(sourceText);