How i can get instance of PhpIndex class in my PhpStorm custom plugin?

Hello,

I usage this code, but give exception
java.lang.IllegalStateException: @NotNull method com/jetbrains/php/PhpIndex.getInstance must not return null at com.jetbrains.php.PhpIndex.getInstance(PhpIndex.java:34)
Handler code

public class gotoDeclarationHandler implements GotoDeclarationHandler
{

    @Nullable
    @Override
    public PsiElement[] getGotoDeclarationTargets(PsiElement psiElement, int i, Editor editor) {

        PhpIndex index = PhpIndex.getInstance(psiElement.getProject());
//...............
}

And XML extension declaration

  <extensions defaultExtensionNs="com.intellij">
        <gotoDeclarationHandler implementation="com.my.mod.extension.gotoDeclarationHandler" />
    </extensions>

Any ideas? Thnx

Please sign in to leave a comment.