I've noticed that the code completion for my plugin doesn't work for some positions.
For example, where the | denotes the cursor, at this position
represented by this Psi tree
code completion works fine. But at this position
with this tree
my Reference.getVariants() method isn't even called, and no suggestions is shown.
What is so fundamentally different in the second case? Both completions are right after an error due to an incomplete instruction. ARGS_I is missing in the second case, but in the first case ARGS_I is also incomplete, and in both cases the OP_AT occurs at the top level of the tree.
I guess that IDEA cannot figure out the correct type of the completion and thus doesn't call getVariants(). But what is the crucial difference between the cases?