public interface HintedReferenceHost extends PsiElement
PsiElement.getReferences()
, clients can call getReferences(PsiReferenceService.Hints)
and the implementation
may use the hints for performance optimizations, e.g. to avoid finding and creating references that won't intersect the given offset
(PsiReferenceService.Hints.offsetInElement
) or that have no chance of resolving to a particular target
(PsiReferenceService.Hints.target
).Iconable.IconFlags, Iconable.LastComputedIcon
ARRAY_FACTORY, EMPTY_ARRAY
ICON_FLAG_IGNORE_MASK, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITY
Modifier and Type | Method and Description |
---|---|
PsiReference [] |
getReferences(PsiReferenceService.Hints hints)
Same as
PsiElement.getReferences() , but the implementation may take hints into account and return only references that match these hints. |
boolean |
shouldAskParentForReferences(PsiReferenceService.Hints hints)
Normally in
PsiElement.findReferenceAt(int) , all tree hierarchy is traversed bottom-up and each element is asked for references. |
accept, acceptChildren, add, addAfter, addBefore, addRange, addRangeAfter, addRangeBefore, checkAdd, checkDelete, copy, delete, deleteChildRange, findElementAt, findReferenceAt, getChildren, getContainingFile, getContext, getCopyableUserData, getFirstChild, getLanguage, getLastChild, getManager, getNavigationElement, getNextSibling, getNode, getOriginalElement, getOwnReferences, getParent, getPrevSibling, getProject, getReference, getReferences, getResolveScope, getStartOffsetInParent, getText, getTextLength, getTextOffset, getTextRange, getTextRangeInParent, getUseScope, isEquivalentTo, isPhysical, isValid, isWritable, processDeclarations, putCopyableUserData, replace, textContains, textMatches, textMatches, textToCharArray, toString
getUserData, putUserData
PsiReference [] getReferences(PsiReferenceService.Hints hints)
PsiElement.getReferences()
, but the implementation may take hints into account and return only references that match these hints.
But it's not a hard requirement, so the clients should not rely that only matching references will be returned.hints
- the hints about the desired referencesboolean shouldAskParentForReferences(PsiReferenceService.Hints hints)
PsiElement.findReferenceAt(int)
, all tree hierarchy is traversed bottom-up and each element is asked for references.
Quite often it's not needed, because references tend to be contained close to the tree leaves, and their ancestors won't return anything
useful for given offsets anyway. This method makes it possible to stop such bottom-up traversals early and thus improve performance,
if the implementation knows for sure that no tree ancestor of this element can contain references matching the specified hints.hints
- the hints about the desired references