use of com.intellij.codeInsight.template.impl.TemplateImpl in project intellij-community by JetBrains.
the class EmmetUpdateTagAction method expandTemplate.
@Nullable
private static String expandTemplate(@NotNull String abbreviation, @NotNull PsiFile file, @NotNull Editor editor) throws EmmetException {
final CollectCustomTemplateCallback callback = new CollectCustomTemplateCallback(editor, file);
ZenCodingTemplate.expand(abbreviation, callback, XmlZenCodingGeneratorImpl.INSTANCE, Collections.emptyList(), true, Registry.intValue("emmet.segments.limit"));
TemplateImpl template = callback.getGeneratedTemplate();
return template != null ? template.getTemplateText() : null;
}
use of com.intellij.codeInsight.template.impl.TemplateImpl in project intellij-community by JetBrains.
the class XmlZenCodingGenerator method generateTemplate.
@Override
public TemplateImpl generateTemplate(@NotNull TemplateToken token, boolean hasChildren, @NotNull PsiElement context) {
String s = toString(token, hasChildren, context);
TemplateImpl tokenTemplate = token.getTemplate();
assert tokenTemplate != null;
TemplateImpl template = tokenTemplate.copy();
template.setString(s);
return template;
}
Aggregations