Can't edit scope constraints. (no variants for ""). 2.0 and 2.5 EAP
Hi, I was trying to work through the Calculator tutorial from scratch.
However, when I get to "http://www.jetbrains.com/mps/docs/tutorial.html#Creating_a_scope_for_InputFieldReference" I come unstuck.
No matter what I do, I can't reference anything in the search scope.
Autocompletion just yields: no variants for ""
Curiously, this works fine in the downloadable Tutorial sourcecode.
I have compared my project with the downloaded one, I can't see any difference that would explain why my version can't add a scope constraint, and the downloaded project can.
Please, can anyone help?
I have attached my faulty project.
Many thanks
Dan
MpsDemo.zip (135KB)
However, when I get to "http://www.jetbrains.com/mps/docs/tutorial.html#Creating_a_scope_for_InputFieldReference" I come unstuck.
No matter what I do, I can't reference anything in the search scope.
Autocompletion just yields: no variants for ""
Curiously, this works fine in the downloadable Tutorial sourcecode.
I have compared my project with the downloaded one, I can't see any difference that would explain why my version can't add a scope constraint, and the downloaded project can.
Please, can anyone help?
I have attached my faulty project.
Many thanks
Dan
MpsDemo.zip (135KB)
Please sign in to leave a comment.
this is a problem of missing dependencies. If you add j.m.baseLanguage, j.m.lang.constraints and j.m.lang.smodel to the list of imported languages of your "Constraints" aspect you should be good to go.
These dependencies are not set automatically.
Vaclav
I hadn't realised that 'structure, editor, constraints, behaviour, typesystem, etc' components of my language all have their own independent module properties! I assumed they inherited from the properties of the parent "Lanugage" module.
I'd been adding j.m.smodel, etc into the "Used Languages" and "Dependencies" list in the Language module, but it had no effect.
Perhaps you could update your tutorial to add this "add j.m.smodel to constraints" step?
While I'm on the topic - another undocumented aspect to the tutorial is the "Running generated code":
I seem to remember I had to add "j.m.execution.util" as an "Extended language" in the language module properties.
I also had to make my Calculator structure node implement "IMainClass" (which isn't documented).
Many thanks
Dan
The tutorial is a bit out-dated and will get a face-lift soon.
In the meantime, you may like to checkout the recently shot tutorial screen-cast - http://tv.jetbrains.net/videocontent/the-introductory-calculator-language-tutorial
http://tv.jetbrains.net/videocontent/the-introductory-calculator-language-tutorial-constraints-and-type-system