Open JohannesMeierSE opened 10 months ago
I am willing to work on this issue.
This is working as intended. The parser rule is indeed unused. You're supposed to use a type union instead.
This is working as intended. The parser rule is indeed unused. You're supposed to use a type union instead.
I see, that makes sense.
What do you think about showing a corresponding hint with a quick-fix to replace the parser rule by the following union type?
grammar HelloWorld
entry Model:
(persons+=Neighbor | friends+=Friend | greetings+=Greeting)*;
Neighbor:
'neighbor' name=ID;
Friend:
'friend' name=ID;
type Person = Neighbor | Friend;
Greeting:
'Hello' person=[Person:ID] '!';
hidden terminal WS: /\s+/;
terminal ID: /[_a-zA-Z][\w_]*/;
Sure, I think that's good 👍
The following grammar uses the (unassigned) parser rule
Person
as type in the cross-reference ofGreeting
in order to link toNeighbor
s orFriend
s:The current behavior
Nevertheless, the parser rule
Person
is marked as "unused", e.g. in the Playground:The expected behavior
I would expect, that
Person
is not marked as "unused", since it is used as type in the cross-reference.