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

Bug 346669

Summary: [navigation] Navigation History doesn't remember prev. pos after Quick Fix (change type of field)
Product: [Eclipse Project] Platform Reporter: John <M8R-sgiphk>
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, remy.suen
Version: 3.7   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description John CLA 2011-05-20 08:56:23 EDT
Build Identifier: I20110518-2200

after doing a the Quick fix of: Change type of `fieldX` to `type` 
and pressing Esc (instead of Enter) then Alt+left (Navigate->Back) doesn't go back to where the quick fix was issued, instead skips that backstep.

Pressing Enter (instead of Esc, above) does automatically return cursor position to where the quickfix was issued.

I've been hitting this too many times to not report it as it seems to take quite some time to navigate back to where I was and also adds some frustration

Reproducible: Always

Steps to Reproduce:
do this code:
package org.some;


public class X
{
	public int field;
	
	public boolean stuff() {
		return field;
	}
}


=====
2. position yourself on the "field" in "return field;" line
3. press Ctrl+1 to bring up Quick fix and choose `Change type of field to boolean`
4. press Esc
5. press Alt+left or choose Nagivate->back

at this point either nothing happens or you're not going back to the "field" on the "return field;" line as I would expect.

Note that if you change step 4 to "press Enter" then you automatically are returned to the "field" in the "return field;" line, so no need to press Alt+left to get back. So yeah it's probably the right(and only) way to go back but I always press Esc mostly because I find other variables(fields) nearby that I want to change or add some comments about (while I'm still in that area of fields) and then I want to Alt+left to go back to where I was when I applied the quick fix, but no luck. I think the history point for that is never saved, I mean, right before the quickfix is executed.
Comment 1 John CLA 2011-05-20 09:09:19 EDT
you can also try without any step 4.
Comment 2 John CLA 2011-05-21 05:15:48 EDT
perhaps a more fitting example would be:
package org.some;


public class Y
{
	public final int field=0;
	
	public void stuff() {
		field=1;
	}
}


then go to field=1; line and Ctrl+1 and apply the quick fix for `Remove 'final' modifier for 'field'`, then try Alt+left to go back to the field=1; line which will not do so. Neither will Ctrl+Q aka Last Edit Location (but that's understandable for Ctrl+Q)

thanks in advance :)
Comment 3 Remy Suen CLA 2011-05-25 10:35:42 EDT
I guess this is a question of how fine-grained you want the history to be. I believe the text editors are interacting with the navigation history as expected though.
Comment 4 Dani Megert CLA 2011-06-06 09:37:42 EDT

*** This bug has been marked as a duplicate of bug 73224 ***