Bug 278769 - "Add include" sometimes doesnt add includes
Summary: "Add include" sometimes doesnt add includes
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 6.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 6.0   Edit
Assignee: Sergey Prigogin CLA
QA Contact: Doug Schaefer CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-02 09:01 EDT by Jakub Zytka CLA
Modified: 2009-06-03 03:22 EDT (History)
0 users

See Also:
eclipse.sprigogin: iplog-


Attachments
Fix (2.81 KB, patch)
2009-06-03 03:05 EDT, Sergey Prigogin CLA
eclipse.sprigogin: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Zytka CLA 2009-06-02 09:01:16 EDT
Build ID: 200905290807
Version: 6.0.0.200905290807

Steps To Reproduce:
1. have a project as follows:
foo.h:
#ifndef _FOO_H_
#define _FOO_H_

namespace foo
{

struct Foo
{
	Foo();
	// ...
};

}

#endif

--------------------------------------------
foo.cpp:
#include "foo.h"

namespace foo
{

Foo::Foo()
{
}

//...
}

--------------------------------------------
tests/someTest.cpp:

namespace foo
{
namespace test
{

struct TestFoo: Foo
{
};

}
}

2. place cursor within "Foo" in tests/someTest.cpp (alternatively - select Foo)
3. select Add Include from menu or use a shortcut
4. result: nothing happens; expected result:
adding a line
#include "../foo.h"


More information:
class Foo is indexed;
most probably the cause is that required include would contain relative path (if the file using class Foo is not in subdirectory then the include is added correctly)
there isn't any error reported whatsoever

workaround: select Foo, use "Open Element", see where it is declared, add include manually
Comment 1 Sergey Prigogin CLA 2009-06-03 03:05:56 EDT
Created attachment 138099 [details]
Fix
Comment 2 Sergey Prigogin CLA 2009-06-03 03:22:10 EDT
Fixed in HEAD > 20090603.