Migrate over Langium Generation and Integration Guides#1044
Merged
kaisalmen merged 6 commits intoJun 26, 2026
Conversation
kaisalmen
requested changes
Jun 26, 2026
| // your services import will differ based on your language | ||
| import { createMyLanguageServices } from './my-language-module.js'; | ||
|
|
||
| declare const self: DedicatedWorkerGlobalScope; |
Collaborator
There was a problem hiding this comment.
Btw, with this option, you do not need to use WebWorker in the compiler options lib:
/// <reference lib="WebWorker" />
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #868 by bringing over a pair of Langium guides that demonstrated how to integrate & leverage Langium + Monaco. Those have been out of date on the Langium side, and needed a bit of tlc, so I refreshed them and brought them over here. Most of the content is from the original tutorial, but rewritten and adapted for the new MLC api and any changes since Langium 3.X.
The updated sections have been setup so they should follow after the practical examples section, by building up into a Langium context. The first guide is about setting up and integrating an LS worker built on the Langium side (very similar to the existing guide). The second one has been adapted to instead focus on how to work with notifications & requests instead of 'generation' by itself. This broadens the scope of application a bit, so it should be clearer that although generation is a use case, it's not the only thing you could be doing there.
Lastly this keeps with the existing trend of using the langium-minilogo example language. However the guides have both been updated to walk through the process generally as well as concretely via minilogo, so it should be helpful for users who want to know the general flow or see a concrete example.
There's a new minilogo example added in as well for reference, which consumes a pre-built LS rather than integrate the source directly. I updated the language up to Langium v4.3.0 as well, after it had been sitting for a couple years collecting a bit of dust 🧹 .