<< GroovyEclipse code completion | Home | Crazy Sensible Smalltalk >>

Type inferred completions and more

The code completion is now approaching a level where I won't miss the Java editor too much. In fact, some of the code was implemented in Groovy. So what's new? Simple type inferred completions and category completions, including the special case of DefaultGroovyMethods.

Here is what it looks like:
A type inferred field:
Type inferred field
Type inferred locals work in a similar way.

Return types of methods are also inferred, and in this case the type trickles down into the local variable.
Inferred method returns

Where would we Groovy coders be without our DGM?
Default Groovy Methods completions

And of course, completions on the categories we so love to use.
A Java category Completing a category method

Now it's time to fix little glitches (some are visible in the images above) and to keep adding test cases as I find missing completions here and there, as well as get the docs finished. I chased my tail a little too long with odd but show stopping bugs. One involved a bug that disappeared when running in debug mode! The other, a long standing class loader issue that I finally understand (thanks blackdrag).

I am quite pleased with what is working so far, but at the same time I am beginning to fully realize how much this is just the tip of the iceberg. But it is a nice tip - code browsing should be much easier to implement now, as well as proper help popups along side the completions.



Re: Type inferred completions and more

Nice work Ed! Next thing we need is Java -> Groovy -> Java refactoring support. In otherwords the Groovy editor needs to participate in refactoring events like renaming methods :-)

Not easy, but IMO that would be the absolute killer feature.

Re: Type inferred completions and more

Adding refactoring doesn't look too hard except for public method names, the very thing I want most. I wonder how far I can stretch this type inference. It is all very young, but all in good time.

Re: Type inferred completions and more

This looks pretty impressive! Well done!

Re: Type inferred completions and more

Nice work -- this is looking really good!

Re: Type inferred completions and more

Hi,

Sorry for the stupid question. What eclipse plugin are you using in doing this?

Thanks

Re: Type inferred completions and more

James, it is GroovyEclipse, there are links to it on groovy.codehaus.org

Re: Type inferred completions and more

Sorry for the fool question again. But I can't find the link on groovy.codehaus.org. There is a link to groovy eclipse plugin, but it haven't code completion function.

I see some source code on fishEye. Should I build it myself? Does it the thing doing code completion I want ?

Thanks!

Re: Type inferred completions and more

The source is in the repository, but it is not the easiest thing to build at this time. A new update will be published this week. I'd watch the Groovy email lists for details.

Re: Type inferred completions and more

Great work, wish IntelliJ would do that and stop neglecting Groovy developers. If I should move, I'm glad there is good Groovy support in Eclipse, thanks.

Add a comment Send a TrackBack