Skip to content

Where the type checking function should be called #766

Answered by spoenemann
luan-xiaokun asked this question in Q&A
Discussion options

You must be logged in to vote

Do I need to write my own custom document interface?

TypeScript supports interface declaration merging, so you can simply add optional properties to LangiumDocument and assign / use them as you like.

The linker needs the type checking result to do linking, but I'm not sure if the linking takes place after the execution of the callback function.

Usually linking takes place in the linking phase, which visits all cross-references in the document and tries to resolve them. But in case you add a callback between scope computation and linking, and your function accesses the ref property of a reference, lazy linking is triggered by such an access. So if your callback function produces inform…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@luan-xiaokun
Comment options

Answer selected by luan-xiaokun
Comment options

You must be logged in to vote
1 reply
@luan-xiaokun
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
3 participants