int[] (PsiFile file, final int caretOffset) { for (MethodNavigationOffsetProvider provider : MethodNavigationOffsetProvider.EP_NAME.getExtensionList()) { int[] offsets = provider.getMethodNavigationOffsets(file, caretOffset); if (offsets != null && offsets.length > 0) { return offsets; } } Collection<PsiElement> array = new HashSet<>(); addNavigationElements(array, file); return offsetsFromElements(array); }