eclipse-langium / langium

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

include imported used rules in `railroad` result #1174

Closed Yokozuna59 closed 1 year ago

Yokozuna59 commented 1 year ago

Hi there, the current railroad result don't include rules are imported from another .langium file. I would like them to be included in the result.

image

image

weedySeaDragon commented 1 year ago

@Yokozuna59 - It is pulling in the imported 'common/common.langium' file.

The diagram does not include terminals (including hidden ones); terminals are filtered out before the diagram is created.

Do you want terminals to be shown? Perhaps that could be an option.

msujew commented 1 year ago

@weedySeaDragon The issue is that the fragment parser rule TitleAndAccessibilities from common.langium is missing. Given that the generated syntax diagram includes imported rules, it only makes sense that the vscode extension should show those as well.

weedySeaDragon commented 1 year ago

Ah - now I see. I was totally overlooking thatTitleAndAccessibilities was missing from the Info grammar diagram.

I don't use VS code. I have tweaked the code (langium-railroad) to make it easier for me create .html files and the results I have do include the imported files.
I haven't compared my code to the original yet to see why. When I do, I'll post info about the differences here, FWIW.