eclipse-langium / langium

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

Support multi-target references #1509

Open msujew opened 1 month ago

msujew commented 1 month ago

Adds support for multi-target references. These are references that have the possibility to target multiple elements at once. See following illustration for an example:

image

Note that by default, only elements that are defined on the same scope can be targeted. I.e. a multi reference as in the following will only target one element:

image

This behavior can be freely overwritten by adopters of Langium. However, due to the inherent complexity of aligning the References service implementation and the scoping wrt their behavior, this feature is intended for proficient Langium developers.

The intended use cases for this feature are stuff like declaration merging in TypeScript or partial classes in C#.

Contains a bunch of breaking changes:

msujew commented 1 month ago

cc @cdietrich since you were interested in this feature.