eclipse-langium / langium

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

Fix type computation for many optional properties #1473

Closed msujew closed 1 month ago

msujew commented 2 months ago

Closes https://github.com/eclipse-langium/langium/issues/775

Essentially uses a method to compute subgraphs of a type (i.e. the hull between a TypePart and its own end property) and merging them early to prevent exponential runtime behavior. The merging happens every time a subgraph has been successfully traversed (at the end of the recurse method).

Since multiple subgraphs can be chained together, we need a new iterate method that ensures that all subgraphs are traversed to the end of the type.