-
Hi, is there a way to package the CLI app with the generated vscode extension? I understand that this question might have been asked in different ways, but Langium is doing a great job in all aspect, but when it comes to packaging Many Thanks for the efforts. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @lazkany, it really depends on what you want to do with the CLI/generator/interpreter:
Generally, it's no problem to deploy some additional tooling with the vscode extension. One simple example would be to simply run a generator when the Another approach would be to register a command in vscode that does exactly that - it would just send a custom notification to the language server to perform the generation, using the dirty state of all documents to generate some code. Both approaches suffer from some performance issues, as the generation will block the main thread. Something that can be circumvented using worker threads. If you don't need to have it run on dirty states of files, you can just also have the CLI packaged in the vscode extension itself and call There are many more ways of achieving something like that, as you can probably imagine. These are just things that generally work from the top of my head, but it really depends on your use case. |
Beta Was this translation helpful? Give feedback.
Hey @lazkany,
it really depends on what you want to do with the CLI/generator/interpreter:
Generally, it's no problem to deploy some additional tooling with the vscode extension. One simple example would be to simply run a generator when the
DocumentBuilder.onBuildPhase(DocumentState.Validated, callback)
callback triggers. You would then implicitly run the generator on every document that has successfully validated.Another approach would be to register a command in vscode that does exactly …