boolean (@NotNull PsiReference ref, int offset) { if (ref instanceof MultiRangeReference) { for (TextRange range : ((MultiRangeReference)ref).getRanges()) { if (range.containsOffset(offset)) return true; } return false; } return ref.getRangeInElement().containsOffset(offset); }