Multi Language Projects #669
-
I read #642 and https://github.com/langium/langium/pull/311in the context of multi language projects (langium 0.4.0). I wonder what a good starting point would be (an example project). My thoughts so far: I have two DSLs.
(2) a DSL modeling test cases:
now I want the testcase DSL to reference elements from the requirement DSL:
How would I achieve this in langium?
what impact does this have on the DSL architecture? how do services from both DSL interact? How many language servers would I have? How to create an extension or extensions for vscode... With a short introduction I could try to create the above example as langium example with some accompanying docs:
I was confused by the comment in #311 "The changes can be tested with the statemachine example package.": How is this meant? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
If the two languages are totally separate, they can be handled by different language servers (and different vscode extensions). But if you want cross-language references, they need to be processed together (in the same langium-config.json) and run in the same language server. The language server disambiguates requests based on the file extension of incoming URIs. What you mentioned about requirements and tests sounds like a good example that we could add to |
Beta Was this translation helpful? Give feedback.
If the two languages are totally separate, they can be handled by different language servers (and different vscode extensions). But if you want cross-language references, they need to be processed together (in the same langium-config.json) and run in the same language server. The language server disambiguates requests based on the file extension of incoming URIs.
What you mentioned about requirements and tests sounds like a good example that we could add to
examples
in this repo. Ideally with the same structure as the other examples, but with two.langium
files in it (every language needs a dedicated entry grammar). The example might be overly simplistic though, maybe we can make the mode…