public abstract class PsiReferenceRegistrar extends java.lang.Object implements UserDataHolder
The locations are described by ElementPattern
s. If a pattern matches some PSI element, then the corresponding
PsiReferenceProvider.getReferencesByElement(PsiElement, com.intellij.util.ProcessingContext)
is executed, from
which one can return the references whose PsiReference.getElement()
is the same as the first parameter of
PsiReferenceProvider.getReferencesByElement(PsiElement, com.intellij.util.ProcessingContext)
.
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_PRIORITY |
static double |
HIGHER_PRIORITY |
static double |
LOWER_PRIORITY |
Constructor and Description |
---|
PsiReferenceRegistrar() |
Modifier and Type | Method and Description |
---|---|
<T> T |
getUserData(Key<T> key) |
<T> void |
putUserData(Key<T> key,
T value)
Add a new user data value to this object.
|
void |
registerReferenceProvider(ElementPattern<? extends PsiElement> pattern,
PsiReferenceProvider provider)
Register reference provider with default priority (
DEFAULT_PRIORITY ). |
abstract <T extends PsiElement> |
registerReferenceProvider(ElementPattern<T> pattern,
PsiReferenceProvider provider,
double priority)
Register reference provider with custom priority.
|
public static final double DEFAULT_PRIORITY
public static final double HIGHER_PRIORITY
public static final double LOWER_PRIORITY
public void registerReferenceProvider(ElementPattern<? extends PsiElement> pattern, PsiReferenceProvider provider)
DEFAULT_PRIORITY
).pattern
- reference place description. See StandardPatterns
, PlatformPatterns
and their extenders.provider
- provider to be registeredpublic abstract <T extends PsiElement> void registerReferenceProvider(ElementPattern<T> pattern, PsiReferenceProvider provider, double priority)
pattern
- reference place description. See StandardPatterns
, PlatformPatterns
and their extenders.provider
- provider to be registeredpriority
- see #DEFAULT_PRIORITY), {@link #HIGHER_PRIORITY}, {@link #LOWER_PRIORITY}public <T> T getUserData(Key<T> key)
getUserData
in interface UserDataHolder
public <T> void putUserData(Key<T> key, T value)
UserDataHolder
putUserData
in interface UserDataHolder