PsiModifierListOwner (Editor editor, PsiFile file) { final PsiModifierListOwner owner = AddAnnotationPsiFix.getContainer(file, editor.getCaretModel().getOffset(), true); LongRangeSet rangeFromType = rangeFromType(owner); if (rangeFromType == null || !ExternalAnnotationsManagerImpl.areExternalAnnotationsApplicable(owner)) return null; PsiElement original = owner.getOriginalElement(); return original instanceof PsiModifierListOwner ? (PsiModifierListOwner)original : owner; }