| Summary: | [AQL] Completion after metamodel prefix adds a 2nd prefix | ||
|---|---|---|---|
| Product: | [Modeling] Sirius | Reporter: | Etienne Juliot <etienne.juliot> |
| Component: | Core | Assignee: | Laurent Fasani <laurent.fasani> |
| Status: | CLOSED FIXED | QA Contact: | Florian Barbin <florian.barbin> |
| Severity: | normal | ||
| Priority: | P3 | CC: | esteban.dugueperoux, florian.barbin, laurent.fasani, pierre-charles.david, yvan.lussaud |
| Version: | 3.1.0 | Keywords: | triaged |
| Target Milestone: | 6.0.0 | ||
| Hardware: | PC | ||
| OS: | Windows NT | ||
| See Also: |
https://git.eclipse.org/r/115004 https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=a3393ba4f56b52a4dc6b16f4119b1d84b96ba80c |
||
| Whiteboard: | backport | ||
|
Description
Etienne Juliot
I confirm the bug, I have had the same through https://bugs.eclipse.org/bugs/show_bug.cgi?id=484217#c4 At a first sight, the fix seems trivial. Just provide a proposal that complete what the user has already written: String proposal = propFromAQL.getProposal().substring(completionResult.getReplacementLength()); For example aql:self.eAllContents(basicfamily::P+CTRL+SPACE -> proposal=erson But, why have not we got the issue for method completion? aql:self.eAllC+CTRL+SPACE Because, there is a post processing in TextContentProposalProvider.getProposals(String, int) to convert sirius proposal into Jface. The process is not specific to a particular interpreter. It cuts the proposal according to what users has already written (String proposalStart = new ContentContextHelper(contents, position, prefix).getProposalStart()). proposal1: * update TextContentProposalProvider.getProposalStart()to better understand how to cut the proposal. proposal2: * update AQLProposalProvider.getProposals(ExpressionTrimmer, int, IQueryEnvironment, Map<String, Set<IType>>) to let the specific interpreter cut the proposal himself. New Gerrit change created: https://git.eclipse.org/r/115004 Gerrit change https://git.eclipse.org/r/115004 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=a3393ba4f56b52a4dc6b16f4119b1d84b96ba80c Steps to validate: * Create a VSP * In the odesign, create a diagramDescription and a node mapping * In an expression, type "aql:self.eAllContents(ecore::EAtt)", position cursor after EAtt and call the completion then select ecore::EAttribute =>The resulting expression shoulb be "aql:self.eAllContents(ecore::EAttribute)". Available in Sirius 6.0.0, see https://wiki.eclipse.org/Sirius/6.0.0 for details |