views:

161

answers:

2

Hello,

Most IDEs (Eclipse, Netbeans, Intelij) provide contextually smart suggestions about the current statement you're writing. We would like to do the same thing (In Java for Java).

We considered tokenizing the input and building our own abstract syntax trees, but quickly realized that could be a month long project in and of its self. We also started digging through the source code for the above mentioned IDEs, but it appears (correct me if I'm wrong) that the auto-complete code is pretty tightly woven with the rest of the IDE.

We're wondering if anyone knows of a relatively isolated package that we could pull into our project to provide this auto-complete functionality.

Thanks!

A: 

If you use SWT and JFace you can be happy: Autocompletions on the GUI side in Editors are already included, and is discussed in many toturials.

However with Swing you might look a bit further.

What is useful in your context has to be decided by yourself, as far as i am aware, there are no tools for that, except when you using a DSL framework like xText.

Daniel
I believe those are UI toolkits. I'm looking for a backend analysis toolkit. Something similar to org.eclipse.jdt.internal.codeassist.Thanks though.
Jim
A: 

JIDE-Commons offers a simple "completion" feature which can be used, e.g., to complete simple words or file names. Maybe this simple solution already works for you.

mklhmnn