Skip to content

Cross Referencing Issue #798

Answered by luan-xiaokun
Danfs64 asked this question in Q&A
Dec 1, 2022 · 1 comments · 6 replies
Discussion options

You must be logged in to vote

I've had this problem before, your grammar is fine, the solution is to implement your own ScopeComputation (a ScopeProvider can also do this I guess). I think the document explains how langium resolves cross reference very well, you should probably check it out first.

According to my understanding, the problem here is that dee is not visible to the node C (it's not in the scope of C), because dee is in the subtree of B, which is a sibling of C. You need to put it in the scope of C, so the linker can resolve the reference. This includes a guide for scoping in langium, which is a good starting point.

Also, on the langium code example, it also gives a This rule is declared but never referenced

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@luan-xiaokun
Comment options

@Danfs64
Comment options

@joswarmer
Comment options

@msujew
Comment options

@joswarmer
Comment options

Answer selected by Danfs64
# for free to join this conversation on GitHub. Already have an account? # to comment
Category
Q&A
Labels
None yet
4 participants