public class MyDslScopeProvider extends AbstractDeclarativeScopeProvider { public IScope scope_ActionStatement_action(final ActionStatement context, EReference ref) { //get the tail end of the resource path classs tailResource = context.getPath().getVariable().getResource(); List<IEObjectDescription> scope = new ArrayList<IEObjectDescription>(); for (Feature o : tailResource.getFeature()) { if (o instanceof function) { function f = (function) o; Map<String, String> data = new HashMap<String, String>(); String sig = "(" + StringUtils.join(f.getParameters(), ",")+ ")"; data.put("sig", sig); IEObjectDescription d = EObjectDescription.create(QualifiedName.create(f.getName()), f, data); scope.add(d); } } return new SimpleScope(scope); } }
public class MyDslProposalProvider extends AbstractMyDslProposalProvider { @Override protected StyledString getStyledDisplayString( IEObjectDescription description) { if (description.getEClass().equals(MyDslPackage.Literals.FUNCTION)) { return new StyledString(description.getName().toString() + (description.getUserData("sig") == null ? "" : description.getUserData("sig"))); } return super.getStyledDisplayString(description); } }