Autocompletion Stops Working When Adding psi.referenceContributor
Answered
I’m currently developing a Laravel IntelliJ plugin, and I’ve implemented both autocompletion and "Go to Declaration" functionality. Everything was working fine until I added the psi.referenceContributor to handle "Go to Declaration" for Laravel config files. Now, the autocompletion in the config context (via completion.contributor) no longer triggers any suggestions but when I remove the psi.referenceContributor everything works again.
Does anyone know why ?
<extensions defaultExtensionNs="com.intellij">
<completion.contributor language="PHP" implementationClass="at.test.project.config.ConfigCompletionContributor"/>
<psi.referenceContributor language="PHP" implementation="at.test.project.config.ConfigG oToDeclarationHandler"/>
</extensions>
Please sign in to leave a comment.
Your PSI Reference can provide completion items via
com.intellij.psi.PsiReference#getVariants
instead of separate CompletionContributor.Yann Cebron I implemented the
getVariants()
method as suggestedDespite triggering the
getVariants
method and confirming that it generates suggestions, the completion list is not appearing in PhpStorm.Am I missing something?
Please verify passed
rangeInElement
is valid, it must contain the range _within_ the element where reference/completion should occur. Otherwise, try debugging yourgetVariants()
method or try first returning simpleString[]
with dummy completion strings.