Point selection = viewer.getSelectedRange();
((CompilationUnitContextType) contextType).setContextParameters(
document, completionPosition, selection.y);
DocumentTemplateContext context =
(DocumentTemplateContext) contextType.createContext();
int start = context.getStart();
int end = context.getEnd();
IRegion region = new Region(start, end - start);
Template[] templates = Templates.getInstance().getTemplates();
for (int i = 0; i != templates.length; i++)
{
if (context.canEvaluate(templates[i]))
{
proposals.add(new TemplateProposal(
templates[i],
context,
region,