Currently, all cross-EReferences are added to the "normal" Xtext scope by asking on every auto-completion request in a huge if-statement by name comparisons whether the context and reference parameters represent a conventional EReference of the EAST-ADL metamodel---if yes, they are the scope.
As the name comparisons induce change effort if the metamodel evolves (beyond performance issues), incorporate the following things:
In the plugin activator, read all cross-EReferences from the metamodel and add them to a lookup hashmap
Reading all cross-EReferences: Get the EAST-ADL metamodel via the extension point, go to top element, and then traverse all elements and their EReferences.
Probably the hashmap should go with the context element or its name as key, with a list of all outgoing EReferences as value.
In the scope provider, then just ask whether there exists in the lookup hashmap for the given context (key) the given EReference in values list.
Currently, all cross-EReferences are added to the "normal" Xtext scope by asking on every auto-completion request in a huge if-statement by name comparisons whether the context and reference parameters represent a conventional EReference of the EAST-ADL metamodel---if yes, they are the scope.
As the name comparisons induce change effort if the metamodel evolves (beyond performance issues), incorporate the following things: