Skip to content

How to handle multi-languages language servers #1222

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

You must be logged in to vote

Your service registry is missing an override for the all getter:

override get all(): LangiumServices[] {
    return Object.values(this.services);
}

The language server tries to identify whether it needs to register a completion provider based on the info that any service has a completion provider at all. It does this by looking through the all property. In your case, it always stays empty, so no language services are registered.

I've investigated the completion issue a bit and saw that the completion parser arrives at an unexpected state:

The added \n token doesn't appear in the input, but gets added by the lexer. As mentioned before, completion in whitespace-sensitive languages doesn't …

Replies: 2 comments 16 replies

Comment options

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

@msujew
Comment options

@Yokozuna59
Comment options

@msujew
Comment options

@Yokozuna59
Comment options

Comment options

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

@msujew
Comment options

@msujew
Comment options

@msujew
Comment options

Answer selected by Yokozuna59
@Yokozuna59
Comment options

@Yokozuna59
Comment options

@Yokozuna59
Comment options

@msujew
Comment options

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