Cross Referencing Issue #798
-
This is a minimal sample demonstrating a problem I'm having:
With the grammar declared above, the following code:
Gives an error saying it I don't know if this is a bug or something I missed while developing my grammar, so instead of opening an Issue, I'm asking here first if anyone knows why that is happening **Edit: Also, on the langium code example, it also gives a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
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
|
Beta Was this translation helpful? Give feedback.
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 nodeC
(it's not in the scope ofC
), becausedee
is in the subtree ofB
, which is a sibling ofC
. You need to put it in the scope ofC
, so the linker can resolve the reference. This includes a guide for scoping in langium, which is a good starting point.