return Status.OK_STATUS;
}
lastRequestTime = currRequestTime;
try {
final PyEdit pyEdit = editor.get();
if (pyEdit == null || monitor.isCanceled()) {
return Status.OK_STATUS;
}
try {
IDocumentProvider documentProvider = pyEdit.getDocumentProvider();
if (documentProvider == null || monitor.isCanceled()) {
return Status.OK_STATUS;
}
IAnnotationModel annotationModel = documentProvider.getAnnotationModel(pyEdit.getEditorInput());
if (annotationModel == null || monitor.isCanceled()) {
return Status.OK_STATUS;
}
Tuple3<RefactoringRequest, PyRenameEntryPoint, Boolean> ret = checkAnnotations(pyEdit,
documentProvider, monitor);
if (pyEdit.cache == null || monitor.isCanceled()) { //disposed (cannot add or remove annotations)
return Status.OK_STATUS;
}
PySourceViewer viewer = pyEdit.getPySourceViewer();
if (viewer == null || monitor.isCanceled()) {
return Status.OK_STATUS;
}
if (viewer.getIsInToggleCompletionStyle() || monitor.isCanceled()) {
return Status.OK_STATUS;
}
if (ret.o3) {
if (!addAnnotations(pyEdit, annotationModel, ret.o1, ret.o2)) {
//something went wrong, so, let's remove the occurrences
removeOccurenceAnnotations(annotationModel, pyEdit);
}
} else {
removeOccurenceAnnotations(annotationModel, pyEdit);
}
} catch (OperationCanceledException e) {
throw e;//rethrow this error...
} catch (AssertionFailedException e) {
String message = e.getMessage();
if (message != null && message.indexOf("The file:") != -1 && message.indexOf("does not exist.") != -1) {
//don't even report it (the file was probably removed while we were doing the analysis)
} else {
Log.log(e);
Log.log("Error while analyzing the file:" + pyEdit.getIFile());
}
} catch (Throwable initialE) {
//Totally ignore this one
// Throwable e = initialE;
// int i = 0;