Creating plugin that autopopup's basic completion

Any tips/pointers on creating a plugin that mirrors what http://plugins.jedit.org/plugins/?SpeedJava does?

IDEA's code completion is the bulk of the work, the remaining thing is to just have basic completion autopopup all the time in the editor (after a configurable delay).

This should be pretty simple, right? Just hook in to receive keyboard events, watch for when an editor has focus, and then hopefully there's a way to programmatically invoke basic code completion?

(looking to do this in 5.1)

thanks!
-pete

5 comments
Comment actions Permalink

Hello peter,

Actually, IntelliJ IDEA's code completion has autopopup without any plugins.
By default the delay is 1000 ms, but you can change it. Just go to Settings
-> Code Completion.

Best regards,
Alexandra Rusina,
Technical Documentation Team Lead
-


JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"

Any tips/pointers on creating a plugin that mirrors what
http://plugins.jedit.org/plugins/?SpeedJava does?

IDEA's code completion is the bulk of the work, the remaining thing is
to just have basic completion autopopup all the time in the editor
(after a configurable delay).

This should be pretty simple, right? Just hook in to receive keyboard
events, watch for when an editor has focus, and then hopefully there's
a way to programmatically invoke basic code completion?

(looking to do this in 5.1)

thanks!
-pete



0
Comment actions Permalink

Actually, IntelliJ IDEA's code completion has
autopopup without any plugins.
By default the delay is 1000 ms, but you can change
it. Just go to Settings
-> Code Completion.


Yes, but that's not 100% of what I'm looking for. In Settings->Code Completion, the delay is after you press a '.' Given the following code:

void foo( String value ) {

}

if I were to put the curser inside the brackets, I'd like to have the code completion popup appear after a configurable delay. From what I could tell, there is no setting to have it autopopup here in 5.1, thus my idea for a plugin.

Thanks!

-peter

0
Comment actions Permalink

You may want to have a look at Struts Assistant plugin source-code (comes with the dev-package for 6.0), there's a class StrutsAutoPopupController (or similar), which triggers autocompletion-popup at certain points.

0
Comment actions Permalink

>> Actually, IntelliJ IDEA's code completion has
>> autopopup without any plugins.
>> By default the delay is 1000 ms, but you can change
>> it. Just go to Settings
>> -> Code Completion.

Yes, but that's not 100% of what I'm looking for. In Settings->Code
Completion, the delay is after you press a '.' Given the following
code:

void foo( String value ) {

}

if I were to put the curser inside the brackets, I'd like to have the
code completion popup appear after a configurable delay. From what I
could tell, there is no setting to have it autopopup here in 5.1, thus
my idea for a plugin.


Erm - what should it pop up?
Some suggestions:

value
for(
if(
switch(
int i
System.out.println(
try {

The possibilities are pretty much unlimited - and therefore any suggestions
are not likely to be relevant.

Now, on the other hand, if there were a plugin that provided a palette from
which I could drag and drop
common control statements into the code, that would be absolutely ... useless.



Thanks!

-peter



0
Comment actions Permalink

Erm - what should it pop up?


Same thing as what you get when doing basic completion. The main things of use will be local variables in-scope, which appear to be at the center of the list when doing basic completion in a scenario like this.

It would also allow one to enter 'value' by just typing v]]>, to select from the list.

-pete

0

Please sign in to leave a comment.