I am using ‘BlockStatement’ from base-language as the basis for a script language concept. I’ve been experimenting calling Java stubs imported / generated from a Jar (having followed the instructio...

This is an auto-generated question from the MPS Slack community: I am using ‘BlockStatement’ from base-language as the basis for a script language concept. I’ve been experimenting calling Java stubs imported / generated from a Jar (having followed the instructions a href='https://tomassetti.me/how-to-add-jars-and-resources-in-a-jetbrains-mps-project/'here/a)and all worked up to the point where I needed to create a java.util.Date and pass it to one of java stubs. The java.util.Date class isn’t available in the solution - I’ve the JDK into stub library, the language, and the solution, but nothing has resolved this so far. I can clearly see that the Date.class stub is available from the JDK java.util stub ‘model’ (if that’s the right term?), but I’ve been able to find how to make this available within my BlockStatement. Any suggestions or pointers would be very welcome.
5 comments
Comment actions Permalink
Did you import the model that contains the class? Use Ctrl+R and search for Date or use Ctrl+M and search for java.util@stub
0
Comment actions Permalink
Thanks - no I hadn’t appreciated the need to import the model containing the Date with Ctrl-R - I had expected specifying the dependency on the model in the Model properties to be sufficient (I need to go back and get a better understanding of that stuff).
0
Comment actions Permalink
I think you specified _module_ dependency, not _model_ dependency.
0
Comment actions Permalink
You need both.
0
Comment actions Permalink
This is auto-generated question from the MPS Community Slack Workspace. If you want to comment on the question, do it from the Slack workspace
0

Post is closed for comments.