Refer to an accessory model from inside an editor aspect
Hi,
I have created some concept instances inside an accessory model, which are basically predefined constants for the language users. I can use them properly from inside the sandbox.
However a cannot refer to them from inside the editor aspect, not even after I added the accessory model to the editor aspect as dependency. I would like to show the different constants differently to the user (besides their different names), so e.g. one of the constants would be red, the other one would be green, etc.
So, is there any way to refer to an accessory model from inside an editor aspect? (My feeling is that it is not possible due to some bootstrap problems.)
A workaround for this could be that I would define an enum, and each concept instance would refer to a different enum member, and I would use the enum value of the concept instances inside the editor.
Thanks,
David
Please sign in to leave a comment.
I think I found a proper solution. I think I had probably misused the accessory models before, but it would be good if someone more experienced could confirm.
Accessory model + smart references
This is the solution I used, but it has some problems. A simplified version of it looks like this:
And the instances in the accessory model are the followings:
What I like in this solution is that there exists exactly one instance of final-state, and exactly one instance of fail-state.
However, while the users of the language can use these instances easily (in their models they can refer to the instances, intellisense works, etc.), I cannot refer to these instances from the editor aspect, and I guess, I cannot refer to them from the generator aspect either (I did not try it yet).
Moreover, this way the users of the language could also create instances of TransitionTargetConstant, which would not make any sense in my language.
To properly identify these instances inside my editor aspect, I would need to "mirror" the TransitionTargetConstant instances by creating and enum, but this would be very clumsy, and I would still not solve the problem of creating references to these instances from code (e.g. from inside an intention):
Accessory model + normal references
This is similar to the previous solution (and still has the same problems), but it uses normal references instead of smart references:
And the instances in the accessory model are the followings:
The language is simpler; however, the same problems persist.
Furthermore, using normal references like this instead of using smart references has the disadvantage that now we pollutes the definition of the State concept with the knowledge that it can be an ITransitionTarget.
Concepts + smart references
This is the solution that seems to be quite right, and works as well:
What I do not like in this solution is that there exist more instances of final-state, and more instances of fail-state.
However, the users of the language can use final-state and fail-state easily (in their models they can refer to them, intellisense works, etc.), and I can refer to final-state and fail-state from the editor aspect, and from the generator aspect too.
So, this seems to be a quite proper solution, but someone more experienced could confirm.
Thanks,
David
Could anybody confirm whether my solution is right or wrong?
Thanks,
David