use of com.intellij.codeInsight.template.impl.TemplateSettings in project intellij-community by JetBrains.
the class CodeInsightTestUtil method addTemplate.
public static void addTemplate(final Template template, Disposable parentDisposable) {
final TemplateSettings settings = TemplateSettings.getInstance();
settings.addTemplate(template);
Disposer.register(parentDisposable, new Disposable() {
@Override
public void dispose() {
settings.removeTemplate(template);
}
});
}
use of com.intellij.codeInsight.template.impl.TemplateSettings in project intellij-community by JetBrains.
the class CustomTemplateCallback method getMatchingTemplates.
@NotNull
private static List<TemplateImpl> getMatchingTemplates(@NotNull String templateKey) {
TemplateSettings settings = TemplateSettings.getInstance();
List<TemplateImpl> candidates = new ArrayList<>();
for (TemplateImpl template : settings.getTemplates(templateKey)) {
if (!template.isDeactivated()) {
candidates.add(template);
}
}
return candidates;
}
Aggregations