use of org.eclipse.jdt.core.manipulation.CoreASTProvider in project eclipse.jdt.ls by eclipse.
the class CompletionHandlerTest method setUp.
@Before
public void setUp() {
mockLSP3Client();
CoreASTProvider sharedASTProvider = CoreASTProvider.getInstance();
sharedASTProvider.disposeAST();
// sharedASTProvider.clearASTCreationCount();
javaClient = new JavaClientConnection(client);
lifeCycleHandler = new DocumentLifeCycleHandler(javaClient, preferenceManager, projectsManager, true);
}
use of org.eclipse.jdt.core.manipulation.CoreASTProvider in project eclipse.jdt.ls by eclipse.
the class DiagnosticsCommand method getNonProjectCompilationUnits.
private static List<ICompilationUnit> getNonProjectCompilationUnits(ICompilationUnit target, IProgressMonitor monitor) {
List<ICompilationUnit> candidates = new ArrayList<>();
CoreASTProvider sharedASTProvider = CoreASTProvider.getInstance();
if (target == null) {
List<ICompilationUnit> workingCopies = Arrays.asList(JavaCore.getWorkingCopies(null));
for (ICompilationUnit wc : workingCopies) {
if (JDTUtils.isDefaultProject(wc) || !JDTUtils.isOnClassPath(wc)) {
candidates.add(wc);
}
}
} else {
CompilationUnit unit = sharedASTProvider.getAST(target, CoreASTProvider.WAIT_YES, monitor);
candidates.add((ICompilationUnit) unit.getTypeRoot());
}
return candidates;
}
use of org.eclipse.jdt.core.manipulation.CoreASTProvider in project eclipse.jdt.ls by eclipse.
the class DiagnosticHandlerTest method setup.
@Before
public void setup() throws Exception {
CoreASTProvider sharedASTProvider = CoreASTProvider.getInstance();
sharedASTProvider.disposeAST();
// sharedASTProvider.clearASTCreationCount();
javaClient = new JavaClientConnection(client);
}
Aggregations