@Nullable public PsiReference findReferenceAt(int offset) { TextRange minRange = new TextRange(0, getContents().length()); PsiReference ret = null; for (final Language language : getLanguages()) { final PsiElement psiRoot = getPsi(language); final PsiReference reference = SharedPsiElementImplUtil.findReferenceAt(psiRoot, offset, language); if (reference == null) continue; final TextRange textRange = reference .getRangeInElement() .shiftRight(reference.getElement().getTextRange().getStartOffset()); if (minRange.contains(textRange)) { minRange = textRange; ret = reference; } } return ret; }
@Override public PsiReference findReferenceAt(int offset) { return SharedPsiElementImplUtil.findReferenceAt(this, offset); }
@Override public PsiReference findReferenceAt(int offset) { return SharedPsiElementImplUtil.findReferenceAt(getPsi(getBaseLanguage()), offset); }