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


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(
Handler code

public class gotoDeclarationHandler implements GotoDeclarationHandler

    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="" />

Any ideas? Thnx

Please sign in to leave a comment.