NPE at com.intellij.psi.SmartPointerManager.getInstance

good day.
i'm writing my custom language plugin and added completion for it.

it works fine but today i tried to complete at some language structure where i think i did not tried yet and got NPE

java.lang.NullPointerException
at com.intellij.psi.SmartPointerManager.getInstance(SmartPointerManager.java:22)
at com.intellij.codeInsight.lookup.LookupItem.setObject(LookupItem.java:35)
at com.intellij.codeInsight.lookup.LookupItem.]]>(LookupItem.java:16)
at com.intellij.codeInsight.lookup.LookupItemUtil.objectToLookupItem(LookupItemUtil.java:157)
at com.intellij.codeInsight.completion.CompletionVariant.a(CompletionVariant.java:173)
at com.intellij.codeInsight.completion.CompletionVariant.addReferenceCompletions(CompletionVariant.java:28)
at com.intellij.codeInsight.completion.CompletionVariant.addReferenceCompletions(CompletionVariant.java:169)
at com.intellij.codeInsight.completion.CompletionData.completeReference(CompletionData.java:23)
...

Actually SmartPointerManager is openapi so the method is

public static SmartPointerManager getInstance(Project project) {
return project.getComponent(SmartPointerManager.class);
}

So the problem is in project parameter.

But if i restart idea and try to complete at an ordinary place - it works. But after that special place it does not. The question is what have i
broken so i does not ?

Please sign in to leave a comment.