Search in sources :

Example 1 with WorkingCopyOwner

use of org.eclipse.wst.jsdt.core.WorkingCopyOwner in project webtools.sourceediting by eclipse.

the class JsTranslation method reconcileCompilationUnit.

/* (non-Javadoc)
	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#reconcileCompilationUnit()
	 */
public void reconcileCompilationUnit() {
    // if(true) return;
    IJavaScriptUnit cu = getCompilationUnit();
    if (fCompilationUnit == null) {
        return;
    }
    if (cu != null) {
        try {
            synchronized (fLock) {
                // clear out old validation messages
                WorkingCopyOwner workingCopyOwner = getWorkingCopyOwner();
                JsProblemRequestor problemRequestor = (JsProblemRequestor) workingCopyOwner.getProblemRequestor(cu.getWorkingCopy(getProgressMonitor()));
                if (problemRequestor != null && problemRequestor.getCollectedProblems() != null)
                    problemRequestor.getCollectedProblems().clear();
                cu.reconcile(IJavaScriptUnit.NO_AST, true, true, getWorkingCopyOwner(), getProgressMonitor());
            }
        } catch (JavaScriptModelException e) {
            Logger.logException(e);
        }
    }
}
Also used : WorkingCopyOwner(org.eclipse.wst.jsdt.core.WorkingCopyOwner) JavaScriptModelException(org.eclipse.wst.jsdt.core.JavaScriptModelException) IJavaScriptUnit(org.eclipse.wst.jsdt.core.IJavaScriptUnit)

Aggregations

IJavaScriptUnit (org.eclipse.wst.jsdt.core.IJavaScriptUnit)1 JavaScriptModelException (org.eclipse.wst.jsdt.core.JavaScriptModelException)1 WorkingCopyOwner (org.eclipse.wst.jsdt.core.WorkingCopyOwner)1