Support for computed properties #1507
Replies: 3 comments 1 reply
-
Another variant of this that i also found that would be useful:
|
Beta Was this translation helpful? Give feedback.
-
Just to mention that in Xtext this was supported by |
Beta Was this translation helpful? Give feedback.
-
Hey @joao-silveira, One of Langium's goals was to stay away from the complexity that EMF introduced to Xtext and keep things simple. By now, the core framework is mostly feature complete, and additional functionality (serialization, type systems, etc.) will likely be added as separate packages. With that in mind, it's unlikely that we plan to support such a feature. Looking at the implementation, you will also see that things work quite a bit differently compared to Xtext, as the whole AST is class-less/prototype-less. We don't plan to introduce more complexity in that region either. |
Beta Was this translation helpful? Give feedback.
-
Are there any plans for supporting node properties whose value is computed from other properties in the model?
In my use case I have an interface like:
And a parsing rule where the name is given either by the referenced node, or by an alias if present:
Rough idea would be that we could provide a function that is called when reference linking is done to get the name property from either the reference or the alias property.
Beta Was this translation helpful? Give feedback.
All reactions