Search code examples
intellij-ideaautocompleteintellij-plugin

IntelliJ Plugin Development: LookupElement with class preview


For a custom language I created a CompletionContributor. Everything works fine. But I'm limited to the information I can display (only in the list or the bottom "advertisement" and only 1 line).

When trying to auto-complete on a java class name it will display more information on the selected line in a small side window. I would like to exploit that mechanism but I really don't know how it is done.

When looking at the options provided, I can use a custom LookupElementRenderer but there is no method in LookupElementPresentation related to the right window.

Any idea how it is done?


Solution

  • Are you referring to documentation popup which may be displayed if the corresponding setting (Setting->Editor->General->Code completion->Show the documentation popup in) is turned on?

    If you want the feature to work for your language you have to use lang.documentationProvider extension point.