use of com.intellij.psi.PsiInvalidElementAccessException in project intellij-community by JetBrains.
the class ResolveResultList method poke.
// Allows to add non-null elements and discard nulls in a hassle-free way.
public boolean poke(final PsiElement what, final int rate) {
PyPsiUtils.assertValid(what);
if (what == null)
return false;
if (!(what instanceof LightElement) && !what.isValid()) {
throw new PsiInvalidElementAccessException(what, "Trying to resolve a reference to an invalid element");
}
super.add(new RatedResolveResult(rate, what));
return true;
}
Aggregations