langium
langium copied to clipboard
Improve cross references for declaration merging
Currently, a cross reference can only ever point to a single element. For features such as declaration merging (i.e. with interfaces in TypeScript), it might make sense to adapt the cross reference resolution/grammar to allow multiple elements for a cross reference target, so that these can be merged during the scoping process.
Ideally, we would declare explicitly where we want to resolve to multiple targets in the grammar. At the declaration site, it could look like this:
interface Foo {
myRef: @Target[]
}
But how do we specify it at the assignment? Maybe with a *?
Foo: myRef=[Target* : ID];