more smart code completion

just wonder if this could be useful:

on ctrl-shift-space for a method parameter IDEA showed
me MyClass.getInstance(String param) as suggestion,
which is quite cool, as it needs to find out that you
can retrieve an instance of MyClass that way.

But maybe this could be taken very much further.
In my case, the String param comes from the method
getMyParam() from a local variable of type MyConfig.
If IDEA would analyse the rest of the code in my project,
it could see that the param to MyClass.getInstance is
mostly received by a call to MyConfig.getMyParam()
-> so it could also detect the local variable and
suggest me cfg.getMyParam() when ctrl-shift-space inside

Is it possible / useful? Or would it take too long
to analyze / or the caches would become too big?


1 comment

I swear that I filed a bug about almost exactly this behavior, but I can't find it in the Tracker. Basically I would like IDEA to show me all possible paths to objects of a given type, even if it involves many method calls.

I did report a related bug, which requests that a Map's values(), keySet(), and entrySet() be included in the SmartType completion.


Please sign in to leave a comment.