custom aspects: accessing aspect source language
The custom aspects implemented in 3.3 is nice, and the cookbook is pretty good to show how to access the runtime of the a new custom aspect.
I am wondering how to access root nodes of the aspect from other aspects. For instance, in the editor, I want to reference root nodes defined in a custom aspect of the same language.
How would I get a reference to the source of the custom aspect, not its runtime?
More specifically, I have:
Language
editor cell model
here I need to reference R1. Not sure how to write the scope to show only root nodes of a certain kind in the custom aspect.
Root node R1
I am wondering how to access root nodes of the aspect from other aspects. For instance, in the editor, I want to reference root nodes defined in a custom aspect of the same language.
How would I get a reference to the source of the custom aspect, not its runtime?
More specifically, I have:
Language
- editor aspect
here I need to reference R1. Not sure how to write the scope to show only root nodes of a certain kind in the custom aspect.
- custom aspect
Please sign in to leave a comment.
Surely it needs and will be improved further.
Regards,
Mihail
this.model.module.model.where({~it =>
it. isAspectModel unknown here.
model m = it.<operation>; });
I reach a point where isAspectModel is not defined on the model. I see isAspectModel on an object of type model, but what the iterator is is not that and a cast does not seem possible.
It appears that the iterator is a ModelReference instance, and I am not sure how to resolve the reference to a model.
This class also contains another useful method:
> The custom aspects implemented in 3.3 is nice, and the cookbook is pretty good to show how to access the runtime of the a new custom aspect.
Can someone please direct me to any documentation about these custom aspects?
Greatest thanks in advance!
P.S.
Do I understand it right, that this feature allows me to declare "an aspect" in my language, so users later can create "models of this aspect" in their solutions, when using my language?
It would be awesome.
Yes, custom aspects extend the language definition capabilities the way you describe.
I think you are looking for https://confluence.jetbrains.com/display/MPSD33/Custom+Aspect and https://confluence.jetbrains.com/display/MPSD33/Custom+language+aspect+cookbook
Vaclav