Open grafandreas opened 1 month ago
Hey @grafandreas,
can you post a reproduction example? I've seen some complaints about it, but failed to reproduce the issue as of now.
i have encounter similar issue by override getDocumentHighlight
method in DefaultDocumentHighlightProvider
@zrwsmd Can you reproduce this consistently? Can you share a reproducible example?
Probably this is not the reason but I ran into this error when accidentally using ?=
to assign a value to a property of type boolean combined with a rule.
In this example (which might not be very reasonable) :
entry Model:
persons+=Person*;
Person:
'person' name=ID isXYZ?=PersonPredicate;
PersonPredicate:
'knows' other=[Person:ID];
Using this input:
person Foo knows Bar
person Bar knows Foo
The error AST node has no document.
occurs (related to the cross references after knows
).
This might be just because of an incorrect definition but maybe this can serve as a litte hint.
A Boolean assignment with a non-primitive right-hand-side should actually be forbidden. We need a grammar validation check for that.
When working on a new grammar / language, I see the issue that in Linking and other situations, Langium fails with
Error: AST node has no document. at getDocument (c:\Users\agraf.vscode\extensions\undefined_publisher.XXXXX-0.0.1\out\language\main.cjs:10601:11)
Since in @cdietrich 's report on the formatter he mentions "the" AST node has no document bug, I assume it is already known. Is there further information on that bug?
Regards,
Andreas