Which TOPIC do i need to subscribe to use LookupListener?

Answered

Hey,

I'm creating a plugin that needs to react on the user selecting a `LookupElement`. For example, the user types `vo` and autocompletes that to `void`. From what I found, the best way to do this is using the `itemSelected` method of the `LookupListener` interface. 

I made a `LookupListener` implementation but I can't seem to find the correct topic to subscribe to for this. This event doesn't seem to have a TOPIC according to https://plugins.jetbrains.com/docs/intellij/extension-point-list.html#intellij-platform-listeners. 

This is what i added to my plugin.xml:

<projectListeners>
<listener class="com.company.test.TestLookupListener" topic="com.intellij.codeInsight.lookup.LookupListener"/>
</projectListeners>

Unfortunately, my `TestLookupListener doesnt seem to recieve any events? 

Any pointers are greatly appreciated, thanks!

2 comments
Comment actions Permalink

Hi,

It can be done with com.intellij.codeInsight.lookup.LookupManagerListener.

0
Comment actions Permalink

Ah, i see and then I can add my LookupListener to the manager using lookup.AddLookupListener(myListener). Thanks for the pointer!

0

Please sign in to leave a comment.