Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 471900

Summary: Support quick navigation to service method implementation
Product: [Modeling] Sirius Reporter: Pierre-Charles David <pierre-charles.david>
Component: CoreAssignee: Pierre Guilet <pierre.guilet>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: florian.barbin, maxime.porhel, melanie.bats
Version: 3.0.0Keywords: triaged
Target Milestone: 6.0.0   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/52797
https://git.eclipse.org/r/52846
https://git.eclipse.org/r/51573
https://git.eclipse.org/r/113426
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=7020d739907f91945c4fd8537938d61777480192
https://git.eclipse.org/r/116096
https://git.eclipse.org/r/116117
https://git.eclipse.org/r/116241
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=38b64d8ada8aac566847ce67c2818e0af471832e
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=627b435006fc5793783233f2f1a419dc5c86599d
https://git.eclipse.org/r/117139
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=65b2a37184b2d5060bf853a655c9e0a5afcaa390
https://git.eclipse.org/r/123470
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=8c8830b0cf085dfabcff4310c6790ca7ec74f021
Whiteboard:
Attachments:
Description Flags
Use case none

Description Pierre-Charles David CLA 2015-07-06 05:07:34 EDT
When editing an interpreted expression which invokes a Java service, it should be possible to navigate directly to the service implementation(s) using a simple key binding and/or menu action.

This should work at least for service: invocation. For the other languages which embed service calls possibly deep inside complex expressions, we would probably need to add new APIs.

Ideally, when I have the cursor inside an interpreted expression of the form "service:myServiceCall", hitting F3 should open the Java editor on the source of the myServiceCall method.

Some open questions:
* service calls support polymorphism, so there is not always *one* unambiguous Java method to go to.
* the source of the service method may not be available.


Some JDT methods that can be useful entry points:
* JavaCore.createCompilationUnitFrom(IFile)
* ICompilationUnit.getPrimary()
* IType.getMethods()
* IEditorPart org.eclipse.jdt.ui.JavaUI.openInEditor(IJavaElement element)

Basically, from an IFile representing a Java source file in the workspace, chaining these can be used to open a Java editor on a specific method in that file.
Comment 1 Eclipse Genie CLA 2015-07-29 09:52:26 EDT
New Gerrit change created: https://git.eclipse.org/r/52797
Comment 2 Eclipse Genie CLA 2015-07-30 07:04:42 EDT
New Gerrit change created: https://git.eclipse.org/r/52846
Comment 3 Pierre-Charles David CLA 2015-12-15 04:11:26 EST
Moving out of the 4.0 scope for now, along with all the other issues which were there "by default". This does not mean some of these will not be re-integrated at some point, but for now these issues are not part of the roadmap for 4.0.

If you feel strongly about this removal from 4.0 and/or are ready to sponsor the corresponding work, feel free to comment.
Comment 4 Eclipse Genie CLA 2017-12-14 10:23:27 EST
New Gerrit change created: https://git.eclipse.org/r/113426
Comment 6 Pierre-Charles David CLA 2018-01-23 05:04:40 EST
The feature itself is merged, with automated tests. What remains before we can close this:
* add release notes & proper documentation;
* add validation tests in the ticket itself.
Comment 7 Eclipse Genie CLA 2018-01-26 05:49:59 EST
New Gerrit change created: https://git.eclipse.org/r/116096
Comment 8 Eclipse Genie CLA 2018-01-26 10:02:00 EST
New Gerrit change created: https://git.eclipse.org/r/116117
Comment 9 Eclipse Genie CLA 2018-01-29 09:53:20 EST
New Gerrit change created: https://git.eclipse.org/r/116241
Comment 12 Pierre-Charles David CLA 2018-01-30 04:54:33 EST
Fixed, and available in Sirius 6.0M5.
Comment 13 Eclipse Genie CLA 2018-02-12 04:18:08 EST
New Gerrit change created: https://git.eclipse.org/r/117139
Comment 15 Florian Barbin CLA 2018-05-24 09:16:03 EDT
The documentation does not mention that the feature works only with aql or service:
Comment 16 Florian Barbin CLA 2018-05-24 09:17:32 EDT
Created attachment 274176 [details]
Use case
Comment 17 Florian Barbin CLA 2018-05-24 09:20:07 EDT
With the attached project:
* open the ecore.odesign
* Select the Bi-directional EC_Reference edge mapping (Design > Entities > Default)
* Click on getEOppositeEReferences in the Semantic Candidates Expression
* Press F3 -> it should navigate toward the service method in the Java Class.
Comment 18 Eclipse Genie CLA 2018-05-28 11:56:50 EDT
New Gerrit change created: https://git.eclipse.org/r/123470
Comment 19 Pierre Guilet CLA 2018-05-28 11:59:48 EDT
@Florian, the functionality works only for service: and aql:
Documentation has been updated.
Comment 21 Pierre-Charles David CLA 2018-05-29 03:01:15 EDT
Fixed by 8c8830b0cf085dfabcff4310c6790ca7ec74f021.
Comment 22 Laurent Redor CLA 2018-06-27 11:55:36 EDT
Available in Sirius 6.0.0, see https://wiki.eclipse.org/Sirius/6.0.0 for details