Hi.
I’ve spent much time to understand how to do it in my own custom languages and why it didn’t work ![]()
Things that help me to inject references to my psi elements:
- add
override fun getReferences(): Array<PsiReference> = ReferenceProvidersRegistry.getReferencesFromProviders(this)to the element should have references - add
{ implements=["com.intellij.psi.NavigatablePsiElement"] }into thebnfto the according psi element pattern declaration
Do not forget to rebuild parser.
Also I’ve noticed that your snippet has error, there are no “implementation” attribute, so correct version will be: <psi.referenceContributor language="MyLanguage" implementation="xxxxx.MyReferenceContributor" />