Community
Participate
Working Groups
The bundle org.eclipse.sirius.interpreter depends on org.eclipse.sirius.common.acceleo.aql.ide to provide some preferential treatment to the MTL interpreter. The problem comes from this method: org.eclipse.sirius.common.acceleo.interpreter.SiriusContentAssistProcessor.CompletionProposalConverter.apply(ContentProposal) which is using the classes AcceleoContentProposal and AcceleoCompletionProposal. Using the new completion proposal API, ContentProposal2, the MTL interpreter can provide almost the same behavior using the new API but one issue remain: How can we return the image of the content proposal? Removing this dependency to switch to the new API would also have several advantages. We could have the support for the Acceleo 3 Interpreter View without having to provide the Acceleo MTL interpreter (for those who only want to use the AQL one for example) and other interpreters (AQL, feature:, service:, var:) could provide images for their completion proposals. Yet the class ContentProposal2 cannot depend on the user interface so we could improve it to support images using one of the following solutions: 1 - Add a method returning an Object like the EMF LabelProvider public class ContentProposal2 { ... public Object getImage() {} } With such a solution, the SiriusContentAssistProcessor would have to figure out what kind of Object has been returned (URI, URL, Image, ImageDescription, EMF's URI, etc) and then load the image accordingly. It is easy to create the proposal but quite complicated to process it to retrieve the image for JFace (which want an Image). We could thus add another method indicating what kind of image object is provided. public class ContentProposal2 { ... public Object getImage() {} public ImageKind getImageKind() {} public static enum ImageKind { JAVA_URI, EMF_URI, JAVA_URL, JFACE_IMAGE, JFACE_IMAGE_DESCRIPTOR } } This enumeration would make it easier to process the image returned and it would let the Acceleo MTL interpreter provide an image directly quite easily without having to make the ContentProposal depends on an UI bundle. This change would not have a major impact on the Acceleo MTL interpreter. 2 - Add a method with a specific type (URI? URL?) We could also choose a specific type and impose it to everybody. We would just a to select a specific type. public class ContentProposal2 { ... public java.net.URI getImage() {} } Any opinion?
New Gerrit change created: https://git.eclipse.org/r/54689
Gerrit change https://git.eclipse.org/r/54689 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=78c1e69a8c11221ec03652dd2809dc0ede1e41e3
Fixed by 78c1e69a8c11221ec03652dd2809dc0ede1e41e3.
Created attachment 256287 [details] interpreter view with only one contribution The title interpreter view does not allow to choose between the Sirius Interpreter or the Acceleo Interpreter: this might be ok if there is only the Sirius interpreter installed. But the view's title (not the tab title, but the titles where we are used to see the interpreter selection combo) is "< > interpreter" -> it should be Sirius Interpreter or Interpreter. Furthermore the completion is not working anymore in the view on my environment (tested with var:, feature:, acceleo and aql)
Maxime's issue was not a real bug but it has highlighted the fact that while the Sirius composed interpreter can be used without a dependency to the Sirius MTL integration, it still has a dependency to Acceleo IDE UI which contribute its own interpreter to the Acceleo Interpreter View. A new bug detailing this issue can be found here: #476622
Available in Sirius 3.1.0.