How to use model.rootsIncludingImported

I am using model.roots(Concept) to find all roots in a model of a certain concept.  I now need to get all roots of a certain concept in all imported models as well.  I therefore want to use model.rootsIncludingImported(IScope, Concept). But I don't understand the IScope parameters.

First of all if I want to get all imported roots, I don't see why I need a scope.  I expect this to simply follow the import rules as defined in the modules. Tried a null scope, but that does not work :-(.

Secondly, IScope is a deprecated interface in jetbrains.mps.smodel, everywhere else I am using the new Scope class from jetbrains.mps.scope. I would rather not start using a deprecated interface.

Is there another way to get all imported models, so I can query their roots?
1 comment
Jos,

in 3.0.x, please use model.rootsIncludingImported(YourConcept, GlobalScope.getInstance()).
In 3.1 there will be no second parameter, just the concept. I've already removed the IScope parameter from the operation.
IScope is a very old feature in MPS, which by fact is not used now, we plan to remove it completely by 3.1.
0

Please sign in to leave a comment.