@Override
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
int offset) {
try {
ItemSet directiveSet = editor.getItemSet();
Map<String, Class<?>> context = new HashMap<String, Class<?>>();
ContextValue[] values = ConfigurationManager.getInstance(
editor.getProject()).getContextValues(editor.getFile(),
true);
for (int i = 0; i < values.length; i++) {
context.put(values[i].name, values[i].objClass);
}
Item directive = directiveSet.getSelectedItem(offset);
if (null != directive) {
return directive.getCompletionProposals(offset, context);
} else {
// we might be starting something
Item item = editor.getItemSet().getPreviousItem(offset);