/** * Notify this annotation processor that validation has finished in order to clear old markers on * next update * * @param e Validation finished event */ @Subscribe public void finish(ValidationFinishedEvent e) { CheckMode checkMode = e.getCheckMode(); if (e.getUri().equals(fXtextDocument.getResourceURI()) && checkMode != null && checkMode.shouldCheck(CheckType.EXPENSIVE)) { // should check fast means this was a reconcile clearLiveEdits.getAndSet(checkMode.shouldCheck(CheckType.FAST)); // should not check fast means this was an on-save validation clearOnSaveEdits.getAndSet(!checkMode.shouldCheck(CheckType.FAST)); } }
private Boolean runWhileEdit() { // Don't need to lock when accessing resource since this is called inside a write lock XtextResource resource = fXtextDocument.getResource(); Boolean result = false; if (resource != null && resource.getContents().size() > 0 && resource.getContents().get(0) instanceof Body) { Body body = (Body) resource.getContents().get(0); result = fPreferences.get(body, RuntimePref.RUN_WHILE_EDITING); } return result; }