简体   繁体   English

IntelliJ插件开发:带有类预览的LookupElement

[英]IntelliJ Plugin Development: LookupElement with class preview

For a custom language I created a CompletionContributor . 对于自定义语言,我创建了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). 但是我仅限于可以显示的信息(仅在列表中或底部的“广告”中,只有1行)。

When trying to auto-complete on a java class name it will display more information on the selected line in a small side window. 尝试自动完成Java类名时,它将在一个较小的侧窗口中在所选行上显示更多信息。 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. 在查看提供的选项时,我可以使用自定义的LookupElementRenderer,但是LookupElementPresentation中没有与右窗口相关的方法。

Any idea how it is done? 知道如何完成吗?

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. 如果您希望该功能适合您的语言,则必须使用lang.documentationProvider扩展点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM