private SQLContext getContext(IDocument document, Template template, final int offset, int length)
    {
        return new SQLContext(
            getContextTypeRegistry().getContextType(template.getContextTypeId()),
            document,
            new Position(offset, length),
            sqlEditor);
    }
Get context

@param document the document
@param template the template
@param offset   the offset
@param length   the length
@return the context
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/templates/SQLTemplatesPage.java