[Shapes Tutorial]Outdated information
Hi,
I am going through the Shapes tutorial here:
https://www.jetbrains.com/help/mps/shapes-an-introductory-mps-tutorial.html#
It suggests to add "node-ptr/Color/.resolve...etc" in the ReferenceMacro in reduce_Circle TemplateDeclarationReference.
But it does not work with this more recent version of MPS:
JetBrains MPS 2019.3.3
Build #MPS-193.1331, built on February 25, 2020
Runtime version: 11.0.5+10-b520.38 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 5.4.19-200.fc31.x86_64
GC: ParNew, ConcurrentMarkSweep
Memory: 2014M
Cores: 4
Registry: ide.mac.message.dialogs.as.sheets=false, idea.invalidate.caches.invalidates.vfs=true
Non-Bundled Plugins: com.vladsch.idea.multimarkdown
So I opened the "shapes" example project directly in the application and I see that instead of the complicated "node-ptr..." there is this ReferenceMacro:
ColorReferenceResolver.findColorDeclaration(node.colorRef.target);
I think the online tutorial needs to be updated.
With kind regards,
Nicolas
Please sign in to leave a comment.
Hello Nicolas,
the code as written in the tutorial is supposed to work. Can you kindly share an error that you are getting?
Best regards,
Vaclav
Unfortunately I already deleted the generator that did not work and move forward :/.
I think MPS couldn't find "staticFields" or "findFirst" method.
I have a completely off-topic question. Is there a simple way to generate a corresponding XSD Schema alongside an XML file?
Sure, a conditional root rule or another root mapping rule should be used to trigger a template for the XSD.
Vaclav
Thank you. What about generating an XSD from the Model, the Language itself rather than a particular Solution?
No, there is no built in support for that, I'm afraid.