if (range.isCollapsed()) {
for (TextAnnotation antn: textAnnotations) {
String value = editor.getDocument().getAnnotation(range.getStart(), antn.getName());
Range actualRange = EditorAnnotationUtil.getEncompassingAnnotationRange(editor.getDocument(), antn.getName(), range.getStart());
if (value != null)
<BUG>addToResult(result, antn.getName(), AnnotationInstance.create(editor.getDocument(), antn.getName(), value, actualRange, AnnotationInstance.MATCH_IN));
</BUG>
}
} else {
editor.getDocument().rangedAnnotations(range.getStart(), range.getEnd(), textAnnotationsNames).forEach(new Consumer<RangedAnnotation<String>>() {

if (range.isCollapsed()) {
for (TextAnnotation antn: textAnnotations) {
String value = editor.getDocument().getAnnotation(range.getStart(), antn.getName());
Range actualRange = EditorAnnotationUtil.getEncompassingAnnotationRange(editor.getDocument(), antn.getName(), range.getStart());
if (value != null)
addToResult(result, antn.getName(), AnnotationInstance.create(editor.getContent(), antn.getName(), value, actualRange, AnnotationInstance.MATCH_IN));
}
} else {
editor.getDocument().rangedAnnotations(range.getStart(), range.getEnd(), textAnnotationsNames).forEach(new Consumer<RangedAnnotation<String>>() {
