How to embed an existing language into my DSL and support cross language reference? #1115
-
Hi team. I am building an in-house DSL for modeling our business. I hope it can inline some expressions written by other language (e.g. JavaScript) for calculation. Here is an example:
Requirements:
Questions:
Thanks a lot! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey @suerta-git, embedded programming languages are quite common in vscode, and although we don't have a tutorial on this topic, they do. I haven't developed an embedded language for vscode yet, but the second approach they show (i.e. request forwarding) looks pretty promising. Both can work, though the other approach seems to be associated with a lot of maintenance effort. Unrelated to vscode: I'm not sure how much Langium can help in that regard. Embedded programming languages are generally outside the context of the language server protocol. We try to operate within that as much as possible. |
Beta Was this translation helpful? Give feedback.
Hey @suerta-git,
embedded programming languages are quite common in vscode, and although we don't have a tutorial on this topic, they do. I haven't developed an embedded language for vscode yet, but the second approach they show (i.e. request forwarding) looks pretty promising. Both can work, though the other approach seems to be associated with a lot of maintenance effort.
Unrelated to vscode: I'm not sure how much Langium can help in that regard. Embedded programming languages are generally outside the context of the language server protocol. We try to operate within that as much as possible.