Spurious "Dynamic usages" in my Find Usages results
Hi all,
When I invoke my Find Usages, I frequently (although not always) find some results in the "Dynamic usages" category which are normally duplicates of one of the previous results. Where do these results come from? I can't figure out if I'm somehow returning extra invalid results or if something else is going on.
Cheers,
Colin
Please sign in to leave a comment.
Bumping up an old question of mine here, I'm still seeing this - can anyone offer any insight?
Hi Colin,
Could you provide a problem situation's screenshot?
Denis
Sure, here's an example:


Notice that the first two usages are from exactly the same position and the second one doesn't have the symbol highlighted in bold. If I get the full usages in the toolwindow, it looks like this:
The spurious usage appears under "Dynamic usages".
Do you experience that problem only with closure code?
Denis
Actually, investigating something else entirely I found the solution by chance - my symbols were returning spurious references in some cases.
In case anyone is interested, you get a "Dynamic usage" if you construct the UsageInfo from a PsiReference whose resolve() returns null.