Which TOPIC do i need to subscribe to use LookupListener?



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:

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

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

Any pointers are greatly appreciated, thanks!

评论操作 固定链接


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

评论操作 固定链接

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