eclipse-langium / langium

Next-gen language engineering / DSL framework
https://langium.org/
MIT License
754 stars 68 forks source link

Terminal fragments used in hidden terminals are shown as unused #865

Closed Lotes closed 1 year ago

Lotes commented 1 year ago

Here is a playground link.

Bildschirmfoto 2023-01-09 um 10 19 47

In this example the Ws rule is marked as unused. When we use the COMMON__WS terminal directly in the Hello rule it is working.

Lotes commented 1 year ago

It also seems like the terminal fragments are not accessible through a custom token builder. They are displayed as Error: Missing rule reference.

msujew commented 1 year ago

The logic for all of this is happening in this function:

https://github.com/langium/langium/blob/cd5dc74ea1790bf7075e8c5d4f3607a6652b095e/packages/langium/src/utils/grammar-util.ts#L38-L64

Lotes commented 1 year ago

Thanks, I can fix it, let's see...