How to add default live template byTemplateManager?


I have some live templates by using DefaultLiveTemplatesProvider and templateSet xml files,

 I register a defaultLiveTemplatesProvider in plugin.xml,

<extensions defaultExtensionNs="com.intellij">
<defaultLiveTemplatesProvider implementation="com.lianjia.ide.liveTemplate.MyTemplateProvider"/>

and code fo MyTemplateProvider is:

public class MyTemplateProvider implements DefaultLiveTemplatesProvider {

public String[] getDefaultLiveTemplateFiles() {
return new String[]{

public String[] getHiddenLiveTemplateFiles() {
return new String[0];

 Now I need to post a http request when templates code completion. But I can't find a way to do this http request.

TemplateManager has a listener(com.intellij.codeInsight.template.TemplateManager#startTemplate(com.intellij.openapi.editor.Editor, com.intellij.codeInsight.template.Template, com.intellij.codeInsight.template.TemplateEditingListener)), but TemplateManager seems to need an action or project, I don't know how to create default live templates by using TemplateManager.Can anyone help?


Lianjia Ide

Please sign in to leave a comment.