How to register an InsertHandler with IDEA 8.0 (Diana)

In IDEA 7.0 I used to be able to set the attribute LookupItem.INSERT_HANDLER_ATTR to a com.intellij.codeInsight.completion.LookupItem. This gave me the flexibility to define my own InsertHandler objects.
Now this is not possible any more with 8.0. Is there a way to register my custom InsertHandlers in plugin.xml? Didn't find any hint in the migration guide.

2 comments
Comment actions Permalink

Dan Cioca wrote:

In IDEA 7.0 I used to be able to set the attribute *LookupItem.INSERT_HANDLER_ATTR* to a com.intellij.codeInsight.completion.LookupItem. This gave me the flexibility to define my own InsertHandler objects.
Now this is not possible any more with 8.0. Is there a way to register my custom InsertHandlers in plugin.xml? Didn't find any hint in the migration guide.

---
Original message URL: http://www.jetbrains.net/devnet/message/5231624#5231624

The best way is to create your own LookupElement and implement
getInsertHandler there. LookupElementFactory or new LookupItem will also
give you objects which have setInsertHandler method

0
Comment actions Permalink

Thanks Peter,

I obviously overlooked the setInsertHandler() getInsertHandler() methods of LookupItem. :-)

0

Please sign in to leave a comment.