eclipse - xtext custom scoping: parameters of function -
i trying custom scoping, such if have function in language parameters, want parameters visible until there semicolon, , out of scope, want not visible.
i tried redefine method getscope() in file mydslscopeprovider.xtend
in getscope did this:
if (eclassname=="typedparam" && efeaturename=="type" && contexttype == "typedparam"){ return scopes.scopefor(collections.singleton(context),iscope.nullscope) } this abviosly doesn't working (it doesn't recognize parameters). how can it?
moreover, have question: tried implements methods like:
def iscope scope_<eclass name>_<efeature name>(<context type> context, ereference) although printed names , made sure writing name correct, method never called. (i copied printed following code)
class domainmodelscopeprovider extends abstractdomainmodelscopeprovider { override def iscope getscope(eobject context, ereference reference) { system.out.println("scope_" + reference.getecontainingclass().getname() + "_" + reference.getname() + "(" + context.eclass().getname() + ", ..)" ); return super.getscope(context,reference); } what doing wrong?
thanks!!!
the problem xtext 2.9+ abstractdeclarativescopeprovider no longer default superclass of yourdslscopeprovider. expected override getscope(eobject context, ereference ref)and if elsing there. or change superclass manually. btw can use constants in yourdslpackage.literalsinstead of using manual string constants.
Comments
Post a Comment