Search in sources :

Example 1 with SemanticHighlightingReconciler

use of org.eclipse.che.jdt.javaeditor.SemanticHighlightingReconciler in project che by eclipse.

the class ReconcileTest method init.

@Before
public void init() throws Exception {
    reconciler = new JavaReconciler(new SemanticHighlightingReconciler());
    //.getWorkingCopy(this.wcOwner, null);
    this.workingCopy = project.findType("p1.X").getCompilationUnit();
}
Also used : JavaReconciler(org.eclipse.che.jdt.javaeditor.JavaReconciler) SemanticHighlightingReconciler(org.eclipse.che.jdt.javaeditor.SemanticHighlightingReconciler) Before(org.junit.Before)

Example 2 with SemanticHighlightingReconciler

use of org.eclipse.che.jdt.javaeditor.SemanticHighlightingReconciler in project che by eclipse.

the class ReconcileTest method testSemanticHighlight.

@Test
public void testSemanticHighlight() throws Exception {
    IType type = project.findType("java.lang.Object");
    ICompilationUnit copy = type.getClassFile().getWorkingCopy(DefaultWorkingCopyOwner.PRIMARY, null);
    CompilationUnit unit = copy.reconcile(AST.JLS8, true, DefaultWorkingCopyOwner.PRIMARY, null);
    SemanticHighlightingReconciler reconciler = new SemanticHighlightingReconciler();
    List<HighlightedPosition> positions = reconciler.reconcileSemanticHighlight(unit);
    assertThat(positions).isNotNull().isNotEmpty();
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) CompilationUnit(org.eclipse.jdt.core.dom.CompilationUnit) ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) HighlightedPosition(org.eclipse.che.ide.ext.java.shared.dto.HighlightedPosition) SemanticHighlightingReconciler(org.eclipse.che.jdt.javaeditor.SemanticHighlightingReconciler) IType(org.eclipse.jdt.core.IType) Test(org.junit.Test)

Aggregations

SemanticHighlightingReconciler (org.eclipse.che.jdt.javaeditor.SemanticHighlightingReconciler)2 HighlightedPosition (org.eclipse.che.ide.ext.java.shared.dto.HighlightedPosition)1 JavaReconciler (org.eclipse.che.jdt.javaeditor.JavaReconciler)1 ICompilationUnit (org.eclipse.jdt.core.ICompilationUnit)1 IType (org.eclipse.jdt.core.IType)1 CompilationUnit (org.eclipse.jdt.core.dom.CompilationUnit)1 Before (org.junit.Before)1 Test (org.junit.Test)1