use of org.eclipse.jdt.ls.core.internal.corrections.InnovationContext in project eclipse.jdt.ls by eclipse.
the class SourceAssistProcessor method getInnovationContext.
public static InnovationContext getInnovationContext(CodeActionParams params, IProgressMonitor monitor) {
final ICompilationUnit unit = JDTUtils.resolveCompilationUnit(params.getTextDocument().getUri());
if (unit == null) {
return null;
}
int start = DiagnosticsHelper.getStartOffset(unit, params.getRange());
int end = DiagnosticsHelper.getEndOffset(unit, params.getRange());
InnovationContext context = new InnovationContext(unit, start, end - start);
CompilationUnit astRoot = CoreASTProvider.getInstance().getAST(unit, CoreASTProvider.WAIT_YES, monitor);
if (astRoot == null) {
return null;
}
context.setASTRoot(astRoot);
return context;
}
Aggregations