Community
Participate
Working Groups
Given this tree structure: include/ helloWorld.h -> symlink to src/helloWorld.h src/ helloWorld.h src2/ helloWorld.cpp and content: helloWorld.h ============ #ifndef HELLOWORLD_H_ #define HELLOWORLD_H_ inline void foo() {} #endif /* HELLOWORLD_H_ */ helloWorld.cpp ============== #include "../src/helloWorld.h" int main() { foo(); return 0; } and then "Open declaration" on foo() in helloWorld.cpp. Now, Eclipse goes to include/helloWorld.h, which is incorrect. **BUG 1 Eclipse should follow the symlink and open src/helloWorld.h even if helloWorld.cpp #include "../include/helloWorld.h", but that is not current behavior, too. **BUG 2 And now, we are at include/helloWorld.h, try "Open call hierarchy" on foo(). Eclipse reports: The file 'helloWorld.h' is currently not part of the index. **BUG 3
Why I think Bug-2 is important is because it makes Perforce plugin (p4eclipse) difficult to use. If it is the symlink we open, not the real file, p4eclipse will mark edited on the symlink, but since a symlink cannot have code change, we will fail to check in the code change.
(In reply to Bing-Yi Wong from comment #0) > Now, Eclipse goes to include/helloWorld.h, which is incorrect. **BUG 1 I agree that this is a bug. > Eclipse should follow the symlink and open src/helloWorld.h even if > helloWorld.cpp #include "../include/helloWorld.h", but that is not current > behavior, too. **BUG 2 For me, it opens src/helloWorld.h when opening an include of either form. However, it's possible that the behaviour here is not deterministic. > And now, we are at include/helloWorld.h, try "Open call hierarchy" on foo(). > Eclipse reports: The file 'helloWorld.h' is currently not part of the index. > **BUG 3 This can be worked around by checking Preferences -> C/C++ -> Indexer -> Index unused headers. (In reply to Bing-Yi Wong from comment #1) > If it is the symlink we open, not the real > file, p4eclipse will mark edited on the symlink, but since a symlink cannot > have code change, we will fail to check in the code change. This sounds like a bug in p4eclipse.