langium icon indicating copy to clipboard operation
langium copied to clipboard

Improve cross references for declaration merging

Open msujew opened this issue 2 years ago • 1 comments

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.

msujew avatar Jul 25 '23 11:07 msujew

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];

spoenemann avatar Aug 22 '23 09:08 spoenemann