Smart Completion less smart than it used to be?

For some reason, it seems like smart completion isn't doing its job as skillful as before in earlier versions of IntelliJ.

Example:  I have a statement as such:

private final ConcurrentMap<String, String> myMap = CollectionFactory.

If i do <Ctrl><Shift><Space> after the dot, I get a list of methods...all the methods in the CollectionFactory class.  There is a getConcurrentMap() method with the following signature:

public static <K, V> ConcurrentMap<K, V> getConcurrentMap()

but that's not even the first method in the list...instead, it has this method first:

public static <K, V> Map<K, V> getMap()

And then the completion list includes other methods, such as ones that return a List, or a Set, etc.  Of course, none of those methods return anything with the right signature, so they should really disappear from the completion list when I hit ctrl-shift-space.

I've played with it, and if I *don't* type the dot, and instead just have CollectionFactory (no dot), and hit smart completion 2x, then I get the method I'd expect.  This is definitely a behaviour change, and not a very welcome one.  I'd expect it to do smart completion based on whatever I have typed...why would it fail to do the proper completion if I've been so kind as to supply the dot?  Actually, now I'm noticing an even more interesting nuance.  Having done the completion without the dot, it now suggestions the proper method as soon as I type the dot, which it wasn't before.  However, if I type a 'g' after the dot, it no longer shows the correct method first and instead still shows getMap() as my first choice.  At any rate, it seems like the logic for suggestiong completions might need to be revisited.  It was more usable before, and its inability to perform smart completion  when you've given it extra information makes little sense.

Comment actions Permalink

Of course, I left out the important version information.  I'm running IntelliJ 13.1.5 with JDK 1.7.0_51 on Windows 7.

Comment actions Permalink

Jacy, is ConcurrentMap class imported at the call place, does Goto Declaration work?
If you invoke Smart Completion from menu, not using the shortcut, will it show getConcurrentMap first?
Could you please attach your log (Help | Show log)?


Please sign in to leave a comment.