eclipse-langium / langium

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

Railroad diagrams could optionally exclude unused imported rules #1418

Open RGHenderson opened 3 months ago

RGHenderson commented 3 months ago

In the following example, the type.langium is only imported to be used in a reference. The inclusion of all grammar rules from the imported langium grammar in larger examples can lead to massive, difficult to follow railroad diagrams (especially in languages with sprawling references to many other metamodels, which langium deals incredibly well with).

In a dream scenario, an extension to the railroad diagram concept might include references in some more visible way, but at least allowing filtering of unused grammar rules would leave a cleaner (opinionated...) view of the raw syntax.

image