Completion with template

Is there any way to support templates through the completion item provider api. The idea is that when the user selects the item instead of just text to insert is a template.

1

Sorry, I don't understand you, please provide more details, maybe an example.

0
Avatar
Permanently deleted user

That is exactly what LiveTemplateCompletionContributor does.  You don't need a plugin to get that functionality (File->Settings->Live Templates or, on a Mac, IntelliJ Haxe->Preferences->Live Templates), but if you want to add a set of new default templates for your language, you have an example there.

0

Yes sure, what I want is to create a LookupElement that allows me to set a template as insert text so that when it is selected it will insert that template and move the caret through the template elements. Similar to when the user selects a template, but instead of being contributed from the live template api is being contributed through the completion provide api.

0

LiveTemplateLookupElementImpl might be what you need.

0

请先登录再写评论。