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

Bug 413505

Summary: "Back to" button in editor jumps more that one file back
Product: [Eclipse Project] Platform Reporter: Michael Savisko <savisko>
Component: UIAssignee: Jonas Hungershausen <jonas.hungershausen>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P4 CC: cdtdoug, daniel_megert, Lars.Vogel, marek.husar, psuzzi, yevshif, zeratul976
Version: 4.6   
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:

Description Michael Savisko CLA 2013-07-23 06:31:56 EDT
Pressing F3 in C++ editor on some type name in the file jumpt the editor window to the definition of that type, possible in another file. Then by pressing "back to" button or "Alt+Left arrow" combination must return the editor to previos file. Unfortunately this not always happens - usually the editor gets to previous file.
Comment 1 Nathan Ridge CLA 2015-07-13 03:01:05 EDT
This happens to me too, and it's very annoying.

I looked into this briefly, but the relevant code isn't in CDT. 

  - Open Declaration calls the platform API IWorkbenchPage.openEditor()
    to open the target file

  - The "Navigate -> Back" menu item / "Alt+Left arrow" shortcut is
    also provided by the platform (the action is, as far as I can
    tell, org.eclipse.ui.actions.ActionFactory.BACKWARD_HISTORY).

Therefore, it seems likely that this is a platform bug.
Comment 2 Nathan Ridge CLA 2016-12-09 22:12:28 EST
Sometimes, the result of the navigation isn't even "more than one file back", it's a file you haven't even navigated to recently.

I can also confirm that JDT suffers from this problem, too, not just CDT. Moving to Platform UI component.
Comment 3 Yevgeny Shifrin CLA 2016-12-10 12:49:11 EST
Hi,

I saw this as well.

Thanks,
Yevgeny
Comment 4 Patrik Suzzi CLA 2016-12-12 06:43:11 EST
I cannot reproduce the issue with the Java editor under normal circumstances. I have some additional questions to narrow down the problem.

Does this happen in C++ editor, in Java editor or another editor?
Do you have an idea of which are the steps that can reproduce the issue?
Comment 5 Michael Savisko CLA 2016-12-12 09:03:03 EST
For me it always happened in C++ editor.
Recently I upgraded to new version of Eclipse for C++ , Neon, running on 64-bits Linux. I created a new workspace and started to work on new projects.
For several days everything was Ok, but later, I assume as number of files in the projects grew, this bug suddenly revealed itself again.
There are no specific steps to reproduce this bug - it's just happens at some period of time working on projects, and it doesn't happen for all files, just for some of them without any reason.
Comment 6 Nathan Ridge CLA 2016-12-12 20:17:08 EST
(In reply to Patrik Suzzi from comment #4)
> Does this happen in C++ editor, in Java editor or another editor?

I've seen it in both the C++ and Java editors. I can't comment on other editors because I don't use them.

> Do you have an idea of which are the steps that can reproduce the issue?

Unfortunately, I haven't been able to find reliable steps to reproduce this issue. It just happens intermittently when working on large codebases.
Comment 7 Patrik Suzzi CLA 2016-12-19 20:57:42 EST
Lowering severity because:
- the bug is hardly reproducible
- it is not something seriously, that prevents working.
Comment 8 Yevgeny Shifrin CLA 2016-12-20 15:43:37 EST
Hi,

I have to say this is a serious issue and it is observed on big projects. If you are investigating difficult flows and suddenly back button does not go to correct location it is very ennoying. This issue is not that rare. Try working on a big project and you will see every day at least once. This issue was opened in 2013 and still not handled. So lowering the priority and not handling is not the right direction in my opinion.

Thanks,
Yevgeny
Comment 9 Nathan Ridge CLA 2016-12-20 16:13:00 EST
Perhaps a good way to make progress here would be to add some logging to the relevant navigation history code?

Then, users experiencing the problem, like myself or Yevgeny, could enable that logging, and provide the logs when the problem occurs, and hopefully they can shed some light on what is going on.
Comment 10 Nathan Ridge CLA 2017-04-28 12:57:20 EDT
(In reply to Nathan Ridge from comment #9)
> Perhaps a good way to make progress here would be to add some logging to the
> relevant navigation history code?
> 
> Then, users experiencing the problem, like myself or Yevgeny, could enable
> that logging, and provide the logs when the problem occurs, and hopefully
> they can shed some light on what is going on.

Has this suggestion been considered?

I am encountering this bug multiple times a day, and it is a serious annoyance.
Comment 11 Lars Vogel CLA 2017-04-28 13:13:58 EDT
(In reply to Nathan Ridge from comment #10)
> I am encountering this bug multiple times a day, and it is a serious
> annoyance.

Gerrit patch or reproducable test case is welcome.
Comment 12 Lars Vogel CLA 2018-09-24 05:26:46 EDT
Jonas, can you have a look? I think we can start with a small temporary patch which lists the files via system.out to see what is going on here.
Comment 13 Lars Vogel CLA 2018-11-15 09:38:03 EST
Most likely dup of Bug 162939.

*** This bug has been marked as a duplicate of bug 162939 ***
Comment 14 Nathan Ridge CLA 2019-04-04 16:50:59 EDT
*** Bug 546113 has been marked as a duplicate of this bug. ***