Skip to content

How to extend parsing-only Langium language #1479

Answered by msujew
Yokozuna59 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @Yokozuna59,

you're not supposed to override the shared service instance at all in a language specific service module, since it is set from outside of the module, see here, which is probably why the (pretty cryptic) error message appears. Instead of using the operator on the full ExampleModule, we imagined that adopters would use the API like this:

export const ExampleLspModule: Module<
  ExampleLspServices,
  PartialLangiumServices & ExampleLspAddedServices
> = {
  lsp: {
    completion: () => ... // only override a specific LSP service
  }
};
...
// in the createModule function
const shared = inject(
  createDefaultSharedModule(context),
  ExampleGeneratedSharedModule
);
const example=

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Yokozuna59
Comment options

@Yokozuna59
Comment options

@msujew
Comment options

@Yokozuna59
Comment options

Answer selected by Yokozuna59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants