Replies: 5 comments 10 replies
-
I am looking forward to see some comments. I am also still thinking of how to combine different models (with different meta models). Even with the referenced hello-json example, you do not handle cases, when the json data is changed in the editor... Langium is great an still evolving and I am looking forward to see what this very useful tool brings us in the future. Thank you to the langium team! |
Beta Was this translation helpful? Give feedback.
-
Hey @BCarley, the general solution is usually to convert the externally defined objects into some That's the general, high level overview. That way, you stay inside of the existing scoping system, but allow to reference documents that are loaded somewhat dynamically from a different source. There's also this discussion that is somewhat related to this topic. |
Beta Was this translation helpful? Give feedback.
-
I just saw the updated docs describing multiple languages within one langium project (https://langium.org/guides/multiple-languages/). Good work! I wonder if I could use your hints given above to "glue" two separate langium projects, allowing to reference elements in one dsl from the other... (Including live vscode updates while editing). If you could give some concrete hints I could try something (maybe based on the persons or requirements example). |
Beta Was this translation helpful? Give feedback.
-
For context, this is my first attempt at a
I have prefixed everythnig with |
Beta Was this translation helpful? Give feedback.
-
Question for
My understanding is that we would want to link these to the |
Beta Was this translation helpful? Give feedback.
-
Hello!
I am working through trying to redefine an existing "stateful rule" language with
langium
and would appreciate some advice on the best approach with respect to scopes.Language Background
The aim of the language is to allow users to write rules that evaluate against passed in
data
. The user is able to store previous executions as variables to make the execution stateful. The passeddata
is defined using ajson-schema
document and so I aim to pass this to the language-server by a service.Question
What is the best approach for scoping / validation? I would like to be able to use language server features for the user defined variables, scoped by
rule
andvar
but also suggest and infer types fordata
based on thejson-schema
service.In the included grammar I have followed the
QualifiedName
approach given in the domain model. However, asdata
is not defined in the language itself, and so cannot be included in theScopeComputation
, (as far as I understand) I was not able to use linking.There is an interesting example (hello-json by @goto40) that uses
auto-completion
and avoids linking, but I feel like this would be giving up all the built in linking functionality that makeslangium
so interesting.I have avoided using keywords for scoping
data
as there might be some cases where the passed data causes a clash with some keyword. e.g.data.data > 2
, but I would be interested to hear if this is the best approach.Example Rule
Grammar
Beta Was this translation helpful? Give feedback.
All reactions