ERROR - j.psi.stubs.StubTreeLoaderImpl - Outdated stub in index
Answered
PimplePhpTypeProvider4 in method getType crash with error (ERROR - j.psi.stubs.StubTreeLoaderImpl - Outdated stub in index)
public @Nullable PhpType getType(PsiElement psiElement) {
String signature = getTypeForArrayAccess(psiElement);
if (signature == null) {
signature = getTypeForParameterOfAnonymousFunction(psiElement);
}
if (signature == null) {
return null;
}
Project project = psiElement.getProject();
if (DumbService.isDumb(project) && DumbService.getInstance(project).isAlternativeResolveEnabled()) {
return null;
}
Collection<? extends PhpNamedElement> col;
try {
col = getBySignature(signature, null, 0, project);
} catch (Exception e) {
return null;
}
// Return first element
for (PhpNamedElement elem : col) {
return elem.getType();
}
return null;
}
Please sign in to leave a comment.
I'm sorry, but your question is unclear.
What is not clear here? Complete crash of IDE when executing the call to
Is the community still working? Or are developers somewhere else?
In the first post, you have provided an implementation that calls getBySignature which doesn't come from PhpIndexImpl.java class - there are just following two available:
In between calling getBySignature provided by the PHP plugin's implementation class and your one, there is still some Utils class which always can be the reason for the failure.
Can you provide a minimal example which will let to reproduce such an issue?
Yes, the problem was precisely because of the method getBySignature call located here in PhpTypeProvider4.
Here is a solution to the problem that I "spied" in another plugin.