From 9d0908dce3c4fa78f79d1f22ebdf0371d9ef43ef Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Tue, 26 Mar 2013 21:39:16 +0100 Subject: [PATCH] javadocs --- .../core-api/src/com/intellij/psi/PsiReferenceProvider.java | 6 ++++++ .../src/com/intellij/psi/PsiReferenceContributor.java | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/platform/core-api/src/com/intellij/psi/PsiReferenceProvider.java b/platform/core-api/src/com/intellij/psi/PsiReferenceProvider.java index 799428dbd824..2687aa51f79a 100644 --- a/platform/core-api/src/com/intellij/psi/PsiReferenceProvider.java +++ b/platform/core-api/src/com/intellij/psi/PsiReferenceProvider.java @@ -20,8 +20,14 @@ import com.intellij.util.ProcessingContext; import org.jetbrains.annotations.NotNull; /** + * Allows to inject additional references into an element that supports reference contributors. * Register it via {@link PsiReferenceContributor} or {@link PsiReferenceProviderBean#EP_NAME} * + * Note that, if you're implementing a custom language, it won't by default support references registered through PsiReferenceContributor. + * If you want to support that, you need to call + * {@link com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry#getReferencesFromProviders(PsiElement)} from your implementation + * of PsiElement.getReferences(). + * * @author ik */ public abstract class PsiReferenceProvider { diff --git a/platform/lang-api/src/com/intellij/psi/PsiReferenceContributor.java b/platform/lang-api/src/com/intellij/psi/PsiReferenceContributor.java index 55f4f0d1d8aa..6d51637ff4db 100644 --- a/platform/lang-api/src/com/intellij/psi/PsiReferenceContributor.java +++ b/platform/lang-api/src/com/intellij/psi/PsiReferenceContributor.java @@ -15,6 +15,11 @@ import com.intellij.openapi.extensions.ExtensionPointName; * Some elements return them from {@link PsiElement#getReferences()} directly though, but one should not rely on that * behavior since it may be changed in the future. * + * Note that, if you're implementing a custom language, it won't by default support references registered through PsiReferenceContributor. + * If you want to support that, you need to call + * {@link com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry#getReferencesFromProviders(PsiElement)} from your implementation + * of PsiElement.getReferences(). + * * The alternative way to register {@link PsiReferenceProvider} is by using {@link PsiReferenceProviderBean}. * * @author peter