| Summary: | Code assist in semanticCandidateExpressions has a wrong type for "self" | ||
|---|---|---|---|
| Product: | [Modeling] Sirius | Reporter: | Cedric Brun <cedric.brun> |
| Component: | Diagram | Assignee: | Project Inbox <sirius.diagram-inbox> |
| Status: | RESOLVED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | pierre-charles.david |
| Version: | unspecified | Keywords: | triaged |
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
|
Description
Cedric Brun
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 *** |