Community
Participate
Working Groups
Steps to reproduce : - Create a VSM with a diagram description on ecore.EPackage - Create a Mapping (Edge, Container or Node, they are all failing) - Set a domain class for this mapping : ecore.EReference for instance - trigger the code assist on the semantic candidate expression [self.<CTRL+SPACE>/] => the proposed features are related to the ecore.EReference type instead of the EPackage one. It does not depend on the query language used, aql, mtl or feature, they all fail. "fun fact" : the validation on the other hand uses the right type, which means you ends up with a validation error (rightly so) if you used the completion and did set feature:eType for instance.
It looks like org.eclipse.sirius.ui.tools.api.assist.TextContentProposalProvider.initContext(EObject, EStructuralFeature) to specify the feature for which the proposal is triggered is supposed to be called and is not. Either we never called it and did not notice or we lost some code.
After digging into the history it looks like we never (or not in the last few years) did call this method. Possible fix : change org.eclipse.sirius.editor.tools.api.assist.TypeContentProposalProvider.bindPluginsCompletionProcessors to add a new parameter feature of type EStructuralFeature To get this org.eclipse.sirius.editor.tools.api.assist.TypeContentProposalProvider.bindPluginsCompletionProcessors(AbstractPropertySection, Text, EStructuralFeature) in the implementation of this method call initContext with the given feature. contentProposalAdapter.setView(section); contentProposalAdapter.initContext(null, feature); (the selected EObject itself will be retrieved "on demand" through TextContentProposalProvider.getSelectedElement() update the generator to generate such calls : TypeContentProposalProvider.bindPluginsCompletionProcessors(this, text,getFeature()); I did all of that manually for DiagramElementMappingSemanticCandidatesExpressionPropertySection and it fixed the problem.
This looks like the same regression already identified by https://bugs.eclipse.org/bugs/show_bug.cgi?id=463456#c8 In commit 0a64eb1bc2399e8d72a6b2be8fb3f6acb794589c for bug 463456, the interpreted expressions property sections inheritance was changed from: extends AbstractTextPropertySection implements ContentProposalClient to extends AbstractTextWithButtonPropertySection i.e. we lost "implements ContentProposalClient". But TextContentProposalProvider.getEStructuralFeature() tests if the property section if "instanceof ContentProposalClient" in order to configure the completion context correctly. *** This bug has been marked as a duplicate of bug 463456 ***