}
@Nullable
public static String calculateTemplateText(@NotNull Editor editor, @NotNull PsiFile file, boolean expandPrimitiveAbbreviations) {
if (file instanceof XmlFile) {
final Ref<TemplateImpl> generatedTemplate = new Ref<TemplateImpl>();
<BUG>CustomTemplateCallback callback = createCallback(editor, file, generatedTemplate);
PsiElement context = callback.getContext();</BUG>
ZenCodingGenerator generator = ZenCodingTemplate.findApplicableDefaultGenerator(context, false);
if (generator != null) {
final String templatePrefix = new ZenCodingTemplate().computeTemplateKeyWithoutContextChecking(callback);

}
@Nullable
public static String calculateTemplateText(@NotNull Editor editor, @NotNull PsiFile file, boolean expandPrimitiveAbbreviations) {
if (file instanceof XmlFile) {
final Ref<TemplateImpl> generatedTemplate = new Ref<TemplateImpl>();
CustomTemplateCallback callback = createCallback(editor, file, generatedTemplate);
PsiDocumentManager.getInstance(file.getProject()).commitDocument(editor.getDocument());
PsiElement context = callback.getContext();
ZenCodingGenerator generator = ZenCodingTemplate.findApplicableDefaultGenerator(context, false);
if (generator != null) {
final String templatePrefix = new ZenCodingTemplate().computeTemplateKeyWithoutContextChecking(callback);
