Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.ITypeBinding;
import org.eclipse.jdt.core.dom.TypeDeclaration;
import org.eclipse.jdt.core.manipulation.CoreASTProvider;
import org.eclipse.jdt.core.search.IJavaSearchConstants;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.core.search.SearchEngine;
Expand Down Expand Up @@ -111,12 +112,16 @@ public static List<TestItem> searchCodeLens(List<Object> arguments, IProgressMon
}

public static ASTNode parseToAst(final ICompilationUnit unit, IProgressMonitor monitor) {
final ASTParser parser = ASTParser.newParser(AST.JLS14);
parser.setSource(unit);
parser.setFocalPosition(0);
parser.setResolveBindings(true);
parser.setIgnoreMethodBodies(true);
return parser.createAST(monitor);
final CompilationUnit astRoot = CoreASTProvider.getInstance().getAST(unit, CoreASTProvider.WAIT_YES, monitor);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any difference if setting to WAIT_NO?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check and not very significant difference observed

if (astRoot == null) {
final ASTParser parser = ASTParser.newParser(AST.JLS14);
parser.setSource(unit);
parser.setFocalPosition(0);
parser.setResolveBindings(true);
parser.setIgnoreMethodBodies(true);
return parser.createAST(monitor);
}
return astRoot;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/test-projects/modular-gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repositories {
}

dependencies {
testImplementation('org.junit.jupiter:junit-jupiter:5.5.2')
testImplementation('org.junit.jupiter:junit-jupiter:5.6.0')
}

test {
Expand Down