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

5 comments
Comment actions Permalink

Bumping up an old question of mine here, I'm still seeing this - can anyone offer any insight?

0
Comment actions Permalink

Hi Colin,

Could you provide a problem situation's screenshot?

Denis

0
Comment actions Permalink

Sure, here's an example:
Screen Shot 2013-04-17 at 10.35.59 PM.png
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:
Screen Shot 2013-04-17 at 10.36.47 PM.png
The spurious usage appears under "Dynamic usages".

0
Comment actions Permalink

Do you experience that problem only with closure code?

Denis

0
Comment actions Permalink

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.

0

Please sign in to leave a comment.