TemplateContextType contextType=VerilogPlugin.getPlugin().getContextTypeRegistry().getContextType(contextString);
Template[] templates= VerilogPlugin.getPlugin().getTemplateStore().getTemplates(contextType.getId());
DocumentTemplateContext documnetTemplateContext= new DocumentTemplateContext(contextType, doc, region.getOffset(), region.getLength());
//find a matching template
for (int i= 0; i < templates.length; i++) {
Template template= templates[i];
String pattern = template.getPattern();
pattern = pattern.replace("\t", indentationstring);
pattern = pattern.replace("\r", "");
pattern = pattern.replace("\n", eol);
template.setPattern(pattern);
try {
contextType.validate(template.getPattern());
} catch (TemplateException e) {
continue;
}
if (template.matches(prefix, contextType.getId()) && template.getName().startsWith(prefix)){
String indent = doc.getIndentString(offset);
template = new TemplateWithIndent(template, indent);
HdlTemplateProposal hdlTemplateProposal=new HdlTemplateProposal(template,
documnetTemplateContext,
region,