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

Bug 364670

Summary: [Xtend] Add key binding to navigate between the xtend file and the generated java file
Product: [Modeling] TMF Reporter: Steve Ash <stevemash>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED WORKSFORME QA Contact:
Severity: enhancement    
Priority: P3 CC: sebastian.zarnekow, sven.efftinge
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Steve Ash CLA 2011-11-24 00:45:49 EST
Build Identifier: 

As the generated java files end up being navigated to quite a bit (through Open Type, debugger, stack traces, etc.), it would be very convenient to have easy code navigation support between the generated java source file and the corresponding xtend file.  A key binding would also be good for this to go back and forth between the java file and the xtend file.

Reproducible: Always
Comment 1 Sven Efftinge CLA 2011-11-24 02:05:47 EST
IF you hover+CTRL over a Java type name (being it in the declaration or in a reference) which was generated from Xtend, you should be able to open up the Xtend source.

We are working on making the navigation between Java and Xtend more seamless. 
But this particular problem is solved.
Comment 2 Sebastian Zarnekow CLA 2011-11-24 02:32:59 EST
Is there a way to navigate to the generated source code?
Comment 3 Steve Ash CLA 2011-11-24 02:54:27 EST
Thanks Sven-

In particular I'm thinking about the following user scenarios:
1- if I'm in the xtend editor and I want to see what the generated java code looks like, it would be handy to have a key combo or "navigate to" to get me there.  Although, maybe this isn't particularly useful after the first week or so of using xtend.

2- if I paste a stack trace into the stack trace viewer and click a file:line then it takes me to the java source.  It would be nice to have a key combo or "navigate to" to immediately take me to the corresponding xtend source file.

3- if I am in a java source file in the java editor and I use an xtend class: if I hit F3 on the xtend class it takes me to the java source.  Ideally it would take me to the xtend class.

From your comment were you saying that one of these was already implemented?  I'm using the stable release, not a nightly -- in case thats where the change is.
Comment 4 Sven Efftinge CLA 2011-11-24 03:07:11 EST
(In reply to comment #3)
> Thanks Sven-
> 
> In particular I'm thinking about the following user scenarios:
> 1- if I'm in the xtend editor and I want to see what the generated java code
> looks like, it would be handy to have a key combo or "navigate to" to get me
> there.  Although, maybe this isn't particularly useful after the first week or
> so of using xtend.

I see, we could have that. I'm not totally convinced that it is a good idea to give the generated code that much attraction.

> 
> 2- if I paste a stack trace into the stack trace viewer and click a file:line
> then it takes me to the java source.  It would be nice to have a key combo or
> "navigate to" to immediately take me to the corresponding xtend source file.

So far JDT doesn't provide any means to hook in when it tries to open a Java element in an editor.
I already filed a feature enhancement against JDT and we will definitely do something about it.

> 
> 3- if I am in a java source file in the java editor and I use an xtend class:
> if I hit F3 on the xtend class it takes me to the java source.  Ideally it
> would take me to the xtend class.
> 
> From your comment were you saying that one of these was already implemented? 
> I'm using the stable release, not a nightly -- in case thats where the change is

No it's i the release. But it's not the primary go to declaration. So F3 doesn't work. But if you use hover and CTRL oner the type's name it should allow you to navigate to the Xtend code.
Comment 5 Karsten Thoms CLA 2017-09-19 17:16:46 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 6 Karsten Thoms CLA 2017-09-19 17:28:06 EDT
Closing all bugs that were set to RESOLVED before Neon.0