@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;
 }
Example #2
0
 @Override
 @NotNull
 public PsiReference[] getReferences() {
   return SharedPsiElementImplUtil.getReferences(this);
 }
Example #3
0
 @Override
 public PsiElement getPrevSibling() {
   return SharedPsiElementImplUtil.getPrevSibling(this);
 }
 @Override
 public PsiReference findReferenceAt(int offset) {
   return SharedPsiElementImplUtil.findReferenceAt(this, offset);
 }
 @Override
 public PsiReference findReferenceAt(int offset) {
   return SharedPsiElementImplUtil.findReferenceAt(getPsi(getBaseLanguage()), offset);
 }