void (@NotNull PsiReference ref, @NotNull List<? super PsiFile> filesList, @NotNull IntList startsList, @NotNull IntList endsList) { PsiElement element = ref.getElement(); filesList.add(element.getContainingFile()); TextRange range = element.getTextRange(); TextRange rangeInElement = ref.getRangeInElement(); startsList.add(range.getStartOffset() + rangeInElement.getStartOffset()); endsList.add(range.getStartOffset() + rangeInElement.getEndOffset()); }