How to acces types from textgen


I have implemented a language with generic types (List<T>, etc) within mps. The compiler for the language does support generic types, so I want to have the textgen aspect fix this by generating instances of generic types for all the concrete type arguments they are actually called with. I implemented this by querying the types of all type constructors during textgen, to create a list of all types in use. Trying to build my textgen module however gives an error I do not know how to fix:

Model uses language jetbrains.mps.lang.typesystem with 1 generators(s), none of which is engaged with the active generation plan.

The error disappears if I do not import jetbrains.mps.lang.typesystem in my textgen module, but then I cannot acces the types of any node anymore. I would like to hear any ideas on how to either fix the generator error, or some other way to acces the types of nodes during textgen that does not involve the typesystem.

1 comment
Comment actions Permalink

The textgen aspect is supposed to be rather dumb 1:1 mapping from a model to text. The generation plan of a textgen aspect is fixed and does not include the typesystem language.

What this means is that you will not be able to use type system from textgen. Instead, you need to use a generator to generate all the instances and textgen's job should be simply to write them out.


Please sign in to leave a comment.