Bug 413474 - [EditorMgmt] [navigation] After switching perspective, Back no longer returns to the point where a Hyperlink was clicked
Summary: [EditorMgmt] [navigation] After switching perspective, Back no longer returns...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 normal with 7 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: usability
Keywords:
: 414977 414978 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-07-22 14:46 EDT by Luke Usherwood CLA
Modified: 2019-12-12 02:50 EST (History)
12 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Usherwood CLA 2013-07-22 14:46:32 EDT
STEPS: 
 1. In a Java editor, hold the Ctrl modifier while left-clicking an identifier (which will appear as a hyperlink) to navigate to a new location in the text editor.
 2. Press Alt+Left to "browse back"

Expected: 
 * The editor returns to the location where the hyperlink was clicked

Actual:
 * The editor returns to a previous location in the editing history.

WORKAROUND: 
 * After pressing Alt+Left, pressing Alt+Right can be used to return to the desired location. Note however, pressing Alt+Right a second time does NOT continue browsing forward to the most recent point viewed, as would be expected. It seems the location of the hyperlink target is not added to the browse history either.

Not sure if this first appeared in Juno or Kepler for me, sorry.
Comment 1 Dani Megert CLA 2013-07-23 05:01:12 EDT
I cannot reproduce this using R4.3 [1]. If you can still reproduce with said build, then please provide exact steps. Also, you might just see bug 344058.


[1] http://download.eclipse.org/eclipse/downloads/drops4/R-4.3-201306052000/
Comment 2 Luke Usherwood CLA 2013-07-24 09:06:12 EDT
More exact steps:
 1. From the body of any Java method, insert:
              java.util.ArrayList al;
 2. Ctrl+Click on ArrayList
 3. Ctrl+Click on List
 4. Ctrl+Click on Collection
 5. Press Alt+Left

In my Eclipse, step five lands me at ArrayList.java

Something seems to be stopping "Collection" from going onto the history stack. The toolbar button's dropdown shows:
 * ArrayList
 * MyClass

If instead of step 5, I press Ctrl+Shift+Down (to jump to a point within Collection) everything corrects itself. Both points within Collection are now in the history stack, and the toolbar button's dropdown shows:
 * Collection
 * List
 * ArrayList
 * MyClass

I'm currently using the official Kepler "Release Build id: 20130614-0229" (Classic). Are you sure you need me to retest with an older version?

It doesn't seem related to bug 344058, this happens to me every time.

If it is possibly some plugin conflict / interaction, what other things could I check for, or what information should I post?
Comment 3 Dani Megert CLA 2013-07-25 05:39:34 EDT
(In reply to comment #2)
> More exact steps:
>  1. From the body of any Java method, insert:
>               java.util.ArrayList al;
>  2. Ctrl+Click on ArrayList
>  3. Ctrl+Click on List
>  4. Ctrl+Click on Collection
>  5. Press Alt+Left

I do exactly those steps except:
0a. install
    http://download.eclipse.org/eclipse/downloads/drops4/R-4.3-201306052000/
0b. start with a new workspace using JRE 7
replace 1. with: paste: "java.util.ArrayList al;" into 'Package Explorer'

Step 5 brings me back to Collection.


> I'm currently using the official Kepler "Release Build id: 20130614-0229"
> (Classic). Are you sure you need me to retest with an older version?

The version I gave you is the/our official SDK build without any additional stuff.


> If it is possibly some plugin conflict / interaction, what other things
> could I check for, or what information should I post?

It's possible that a plug-in causes this. E.g. Mylyn tries to hide things which are not related to the current task.
Comment 4 Dani Megert CLA 2013-07-25 05:44:29 EDT
(In reply to comment #3)
> Step 5 brings me back to Collection.

Correction: It brings me from Collection to List.
Comment 5 Luke Usherwood CLA 2013-07-25 09:06:48 EDT
More insight from playing around: After restarting eclipse, or switching to a clean workspace, it starts out working. At some point later, it transitions from the working state to the broken state.

Playing with the clean SDK version from comment 1, I think I've found a trigger that is successful at breaking it: switching perspective. So a complete sequence would be:

Setup:
 0a: Install clean Eclipse SDK (64 bit Windows)
 0b: Start with a new workspace using JRE 7 
 0c: Paste: "java.util.ArrayList al;" into 'Package Explorer'
 0d: Ctrl+Click ArrayList, attach source (from JDK 7 u 25)
 0e: Restart Eclipse

Reproduce:
 1. Open Snippet.java 
 2. Ctrl+Click on ArrayList
 3. Ctrl+Click on List
 4. Ctrl+Click on Collection (observe history is correct)
 5. Switch perspective from Java -> Debug
 6. Open Snippet.java 
 7. Ctrl+Click on ArrayList
 8. Ctrl+Click on List
 9. Ctrl+Click on Collection (observe history is wrong)
10. Press Alt+Left
Comment 6 Dani Megert CLA 2013-08-06 11:18:59 EDT
> 5. Switch perspective from Java -> Debug

This is the crucial step. With that I can also reproduce the problem.

Works fine in 3.x.
Comment 7 Dani Megert CLA 2013-08-06 11:49:36 EDT
This also works in 4.2.x but no longer in 4.3 and 4.4 (I20130805-2000).

Simpler steps without involving JDT:

1. start new workspace
2. create general project 'P'
3. create file named "A" (leave editor open)
4. create file named "B" (leave editor open)
5. create file named "C" (leave editor open)
   ==> history is OK
6. open 'Resource' perspective
7. click on editor tab 'A'
8. click on editor tab 'B'
   ==> history is broken: wants to go back to 'C' instead of 'A'
9. click on editor tab 'C'
   ==> history is broken: wants to go back to 'A' instead of 'B'
Comment 8 Dani Megert CLA 2013-08-13 10:23:29 EDT
*** Bug 414978 has been marked as a duplicate of this bug. ***
Comment 9 Dani Megert CLA 2013-08-13 10:23:33 EDT
*** Bug 414977 has been marked as a duplicate of this bug. ***
Comment 10 Dmitry Dmitry CLA 2013-08-14 05:43:24 EDT
Having the same problem with CDT - editing C files, but perspective is NOT switched - even Editors are not switched, all done in "C/C++" perspecitve with default C editor.
Currently seeking a way to reproduce error - it seems to appear and disappear in the middle of the work
Comment 11 Dmitry Dmitry CLA 2013-08-14 05:45:05 EDT
Sorry, forgot to add
Eclipse CDT   2.0.0.20130613-0530, platform 4.3.0.I20130605-2000
Comment 12 Laurent Barbareau CLA 2013-08-25 12:57:56 EDT
Please, why don't you try to fix that unsupportable bug into a patch or at least E4.3.1 instead of E4.4 ?
Comment 13 Eric Moffatt CLA 2013-08-28 10:14:01 EDT
If we can find the cause then something like this (loss of functionality) would likely be a candidate for back porting to 4.3.2 (SR2).
Comment 14 Michael Heß CLA 2013-09-13 02:43:19 EDT
For everyone else interested in this: I just saw in the recent commits that Eric and Dani have done some work on it this week. --> bug 416902

Thanks a lot to both of you!
Comment 15 Dani Megert CLA 2013-09-13 04:08:46 EDT
(In reply to Michael Heß from comment #14)
> For everyone else interested in this: I just saw in the recent commits that
> Eric and Dani have done some work on it this week. --> bug 416902
> 
> Thanks a lot to both of you!

Unfortunately it does not fix this bug here.
Comment 16 Jacques Stadler CLA 2014-01-27 06:33:22 EST
I could not reproduce this bug with Eclipse 4.3.1.
That is with Build Id: M20130911-1000

Can anybody confirm this?
Comment 17 Luke Usherwood CLA 2014-01-27 07:04:38 EST
I've since moved on to Eclipse 4.4M3 (I20131030-2000, Java 8ea, 32b) and I am happy to report that I don't see the issue there.
Comment 18 Dani Megert CLA 2014-01-30 08:39:26 EST
(In reply to Luke Usherwood from comment #17)
> I've since moved on to Eclipse 4.4M3 (I20131030-2000, Java 8ea, 32b) and I
> am happy to report that I don't see the issue there.

Using the steps from comment 7 shows that the issue is still there in 4.4 M5.
Comment 19 Luke Usherwood CLA 2014-01-30 12:23:04 EST
> Using the steps from comment 7 shows that the issue is still there in 4.4 M5.

Confirmed here too (4.4M3)
Comment 20 John Hendrikx CLA 2017-10-10 10:39:20 EDT
Still seeing this in Oxygen... see comments I posted on https://bugs.eclipse.org/bugs/show_bug.cgi?id=445021
Comment 21 Eclipse Genie CLA 2019-11-22 16:19:09 EST Comment hidden (obsolete)
Comment 22 John Hendrikx CLA 2019-11-23 15:46:15 EST
This is still relevant.  Also see the issue I linked in my earlier comment.  It has more information about why this happens.  It's a rather weird timing issue that looks suspiciously like a hack to fix some other problem.