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

Bug 356275

Summary: Project Explorer: Link with Editor does not work for C/C++ projects
Product: [Tools] CDT Reporter: Axel Mueller <aegges>
Component: cdt-coreAssignee: Anton Leherbauer <aleherb+eclipse>
Status: RESOLVED FIXED QA Contact: Doug Schaefer <cdtdoug>
Severity: normal    
Priority: P3 CC: aleherb+eclipse, cdtdoug
Version: 8.0   
Target Milestone: 8.0.2   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Sample project
none
Preferences none

Description Axel Mueller CLA 2011-08-31 03:05:44 EDT
Build Identifier: Indigo Build id: 20110609-2236, CDT 8.0.0

After upgrading from Helios to Indigo.
"Link to editor" works in Navigator but fails in Project Explorer and C/C++
Explorer. 
As described in https://bugs.eclipse.org/bugs/show_bug.cgi?id=320473#c14 it seems that the tree expansion does not work.

Bug only happens for C/C++ projects. No problem with simple resource projects.

Reproducible: Always
Comment 1 Anton Leherbauer CLA 2011-08-31 03:49:08 EDT
It works for me with a sample hello world project.
Please provide a test case which fails reproducibly.
Do you have any other plugins installed except Eclipse and CDT?
Comment 2 Axel Mueller CLA 2011-08-31 06:03:42 EDT
(In reply to comment #1)
> It works for me with a sample hello world project.
> Please provide a test case which fails reproducibly.
It depends on the depth of the file tree.

src
  sub1
    file1-works
    sub2
      file2-works
      sub3
        file3-does_not_work
Comment 3 Anton Leherbauer CLA 2011-08-31 07:29:46 EDT
Hm, still cannot reproduce. I tried on Windows and Linux, a variety of file types and file tree depths.
Is there maybe something in the log?
Comment 4 Axel Mueller CLA 2011-08-31 08:14:26 EDT
Created attachment 202507 [details]
Sample project

- Import this project into your workspace and open it (do not expand project tree)
- Open Resource: Menu Navigate->Open Resource .. or Shift-Ctrl-R
  and select file1.cpp
=> file1.cpp should be opened in the editor but nothing happens in the Project Explorer

If it still does work as expected for you then close and reopen the project (close file1.cpp before).
Comment 5 Anton Leherbauer CLA 2011-08-31 09:06:42 EDT
Still works for me.  I even installed AnyEdit Tools because the .settings in the sample project indicated that you have that installed, but still no change in behavior.
Comment 6 Axel Mueller CLA 2011-08-31 09:30:44 EDT
Created attachment 202518 [details]
Preferences

I tried with a complete new workspace and my sample project does indeed work as expected. However, after importing the preferences from my actual workspace the problem occured. Unfortunately, I do not know which preference is the cause.
Comment 7 Anton Leherbauer CLA 2011-08-31 09:45:50 EDT
When I enable the preference C/C++ > Appearance > Show source roots at top of projects, it starts to fail.
Comment 8 Andrew Gvozdev CLA 2011-08-31 09:52:36 EDT
(In reply to comment #7)
> When I enable the preference C/C++ > Appearance > Show source roots at top of
> projects, it starts to fail.
Did you enable or disable it? It starts to fail for me when I disable the preference.
Comment 9 Axel Mueller CLA 2011-08-31 09:59:44 EDT
(In reply to comment #8)
> (In reply to comment #7)
> > When I enable the preference C/C++ > Appearance > Show source roots at top of
> > projects, it starts to fail.
> Did you enable or disable it? It starts to fail for me when I disable the
> preference.
Yes, when I disable this preference (my default because of bug #355601 ) it fails. Enabling makes it work again.
Comment 10 Anton Leherbauer CLA 2011-08-31 10:00:18 EDT
(In reply to comment #8)
> Did you enable or disable it? It starts to fail for me when I disable the
> preference.

You are right.  It's enabled by default and I disabled it.
Comment 11 Anton Leherbauer CLA 2011-09-19 05:13:57 EDT
Fixed in master and cdt_8_0.
Comment 12 CDT Genie CLA 2011-09-19 05:23:03 EDT
*** cdt git genie on behalf of Anton Leherbauer ***

    Bug 356275 - Project Explorer: Link with Editor does not work for C/C++ projects

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=e0bca93e1a44e4bb4bb8cc201d8bf26f1f25b939
Comment 13 CDT Genie CLA 2011-09-19 05:23:07 EDT
*** cdt git genie on behalf of Anton Leherbauer ***

    Bug 356275 - Project Explorer: Link with Editor does not work for C/C++ projects

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=ad878d86aa6fc8bce0c734573d6332b8cfba3afa