/** {@inheritDoc} */ @Override protected void waitForValidation() { // Editor tests frequently work by modifying the document. We first need to wait for the reconciler to run, otherwise we may // actually get results from before a document change is reflected in the document's resource, leading to spurious errors. // Note that the XtextReconciler runs with a delay of 500ms. waitForJobsOfFamily(XtextReconciler.class.getName()); super.waitForValidation(); }
private void waitForReconcileToStartAndFinish() { Optional<XtextReconciler> foundReconciler = Optional.ofNullable(getInternalSourceViewer()) .filter(IAdaptable.class::isInstance).map(IAdaptable.class::cast) .map(a -> a.getAdapter(IReconciler.class)).filter(XtextReconciler.class::isInstance) .map(XtextReconciler.class::cast); if (!foundReconciler.isPresent()) { return; } JobStartListener listener = new JobStartListener(); XtextReconciler reconciler = foundReconciler.get(); try { reconciler.join(); reconciler.addJobChangeListener(listener); reconciler.forceReconcile(); synchronized (listener) { while (!listener.isStarted()) { listener.wait(); } } reconciler.join(); } catch (InterruptedException e) { return; } finally { reconciler.removeJobChangeListener(listener); } }
public SadlUiModule(AbstractUIPlugin plugin) { super(plugin); IOConsoleOutputStream iocos = SadlConsole .getOutputStream(MessageType.INFO); System.setOut(new PrintStream(iocos)); System.setErr(new PrintStream(SadlConsole .getOutputStream(MessageType.ERROR))); // this is to prevent XtextReconcilerDebuger from continually reporting // errors when debug level isn't initialized Logger log = Logger.getLogger(XtextReconciler.class); log.setLevel(Level.WARN); }
public JenaUiModule(AbstractUIPlugin plugin) { super(plugin); IOConsoleOutputStream iocos = SadlConsole.getOutputStream(MessageType.INFO); System.setOut(new PrintStream(iocos)); System.setErr(new PrintStream(SadlConsole.getOutputStream(MessageType.ERROR))); // this is to prevent XtextReconcilerDebuger from continually reporting errors when debug level isn't initialized Logger log = Logger.getLogger(XtextReconciler.class); log.setLevel(Level.WARN); }
/** Custom XtextReconciler. */ public Class<? extends XtextReconciler> bindXtextReconciler() { return N4JSReconciler.class; }
public Class<? extends IReconciler> bindIReconciler() { return XtextReconciler.class; }