use of org.eclipse.xtext.ui.codetemplates.templates.Variable in project xtext-eclipse by eclipse.
the class TemplateValidator method checkTemplate.
@Check
public void checkTemplate(TemplateBody template) {
EList<TemplatePart> parts = template.getParts();
boolean cursorDefined = false;
for (TemplatePart templatePart : parts) {
if (templatePart instanceof Variable) {
if ("cursor".equals(((Variable) templatePart).getName())) {
if (cursorDefined) {
warning("More than one cursor was defined", templatePart, TemplatesPackage.Literals.VARIABLE__NAME);
} else {
cursorDefined = true;
}
}
}
}
}
Aggregations