code completion (ctrl_space) - show what class the methods come from

Hi. I am using fest-assert with Groovy and have a question about methodcode completion. I have the following code:

org.fest.assertions.api.Assertions.assertThat(got).

and press ctrl_space to get code completion of the methods. I want to use the 'is' method, and I get two suggestions:
is(Condition condition) // I stripped generics for brevity
is(Object other)

The latter actually comes from DefaultGroovyMethods, and the first one is a fest-assert method. There is no way to tell that, the information doesn't show where the method comes from. In Eclipse, this information is included in the suggestion list, also including DefaultGroovyMethods in the Groovy editor, which is most helpful in such cases.

Is there a way to get this to work in IDEA?

wujek

5 comments
Comment actions Permalink

I actually don't even have to press ctrl_space, as the suggestions pop up automatically.

0
Comment actions Permalink

In most cases this information is not needed, that's why we don't show it. We could show DGM-methods in some other color, for example. Or you can show documentation (Ctrl+Q) or implementation (Ctrl+Shift+I) to see more details about the selected completion variant.

0
Comment actions Permalink

Ah, the CTRL+Q trick is very helpful, it didn't occur to me that I can use it while code completion popup is on (maybe because Eclipse shows it by default, and I thought that as IDEA doesn't it can't ;d). Thanks.
Some immediate information would be helfpul, though. IDEA boasts that I save keystrokes - well, not in this case. And my experience says that with Groovy, that information is not at all unnecessary. Especially in Groovy 2, as there will be extension modules and the like (basicallt, user defined classes that do the same what DGM do) - but I don't know if it is possible for IDEA to suppot this particular feature at all.

0
Comment actions Permalink

Maybe for extension methods we really should show the location string, and as DGM are also
kind of those, this also applies to them. But not for methods coming from the usual Java places: class and
its superclasses. Could you please file a feature request?

0

Please sign in to leave a comment.