I'm currently working on a project, that among other things validates constraints outside of MPS. Therefore I created a language similar to the Alloy.
Now I'm at the point that I need the textual representation of my constraints. In other words: I need something like Ctrl+C in my Editor for any kind of node.
Basically the same problem this (https://mps-support.jetbrains.com/hc/en-us/community/posts/206613685-Code-generation-Why-so-many-steps-) post started with. But unfortunately that post went off-topic.
I found out that MPS gives me two actions for Ctrl+C, both named "Copy":
Both of them have a different functionality.
1 (not what I need):
[facts] Fact null in SandboxSolution.A1
2 (exactly what I need):
all p : person | p not in p.friend
I tried to figure out how they work with the help of my cloned MPS from GitHub. There I found the class jetbrains.mps.ide.actions.CopyNode_Action. This is doing the first Copy-Variant with the help of getDebugText(SNode node) in jetbrains.mps.util.SNodeOperations. But this (as mentioned above) not what I need. I was searching for some hours for the implementation of the second one, but wasn't able to find anything that gives me the String-representation of a node from the editor.
Does anyone here can help me?
Would be glad to hear from you.