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

Bug 326931

Summary: Include browser should use the same file name as the #include directive
Product: [Tools] CDT Reporter: Jens Elmenthaler <jens.elmenthaler>
Component: cdt-indexerAssignee: Project Inbox <cdt-indexer-inbox>
Status: RESOLVED WONTFIX QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3    
Version: 7.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Jens Elmenthaler CLA 2010-10-04 10:59:44 EDT
Build Identifier: HEAD

Consider the following code:

#include <sys/types.h>
#include <sal/types.h>

In the include browser I see types.h two times. Wouldn't it be better to show one node called sys/types.h and another node called sal/types.h?

Reproducible: Always
Comment 1 Markus Schorn CLA 2010-10-06 11:05:30 EDT
Consider two files 'a.c', 'b.c' that include the same header 'a.h':
   'a.c' uses '#include "a.h"'
   'b.c' uses '#include "subdir/a.h"'

Now, it is unclear how to present the included-by tree with your proposal:
  subdir/a.h         a.h
    |_ a.c      or    |_ a.c
    |_ b.c            |_ b.c
Comment 2 Jens Elmenthaler CLA 2010-10-06 11:14:33 EDT
(In reply to comment #1)
> Consider two files 'a.c', 'b.c' that include the same header 'a.h':
>    'a.c' uses '#include "a.h"'
>    'b.c' uses '#include "subdir/a.h"'
> Now, it is unclear how to present the included-by tree with your proposal:
>   subdir/a.h         a.h
>     |_ a.c      or    |_ a.c
>     |_ b.c            |_ b.c
See your point. The only solution I see would be to present the absolute paths. But those are usually long and, thus, affect usability.

I was just surprised at that it appeared two times. But then, I only need to double-click (in either kind of tree), and I immediately see the difference.

I would be fine with closing it. It's up to you;-)
Comment 3 Markus Schorn CLA 2010-10-07 03:01:55 EDT
(In reply to comment #2)
> ... The only solution I see would be to present the absolute paths.
> But those are usually long and, thus, affect usability.
You can use 'Show folders' from the local menu of the include browser.

> I was just surprised at that it appeared two times. But then, I only need to
> double-click (in either kind of tree), and I immediately see the difference.
> I would be fine with closing it. It's up to you;-)
I do that.