Bug 165867 - Open include ignores linked resources
Summary: Open include ignores linked resources
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 4.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.0 M4   Edit
Assignee: Anton Leherbauer CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-11-26 15:43 EST by Sergey Prigogin CLA
Modified: 2009-01-09 15:03 EST (History)
0 users

See Also:


Attachments
Bug fix. (3.84 KB, patch)
2006-11-26 15:44 EST, Sergey Prigogin CLA
no flags Details | Diff
Slightly modified patch for release (5.40 KB, patch)
2006-12-11 03:17 EST, Anton Leherbauer CLA
no flags Details | Diff
Modified patch (5.65 KB, patch)
2006-12-11 03:23 EST, Anton Leherbauer CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Prigogin CLA 2006-11-26 15:43:01 EST
CDT HEAD:
I have a project where include path points to /root/directory and the project contains folders foo, bar and baz folders linked to /root/directory/foo, /root/directory/bar and /root/directory/baz, etc. Open include action opens header file foo/file.h as /root/directory/foo/file.h instead of opening it as a workspace resource MyProject/foo/file.h.
Comment 1 Sergey Prigogin CLA 2006-11-26 15:44:38 EST
Created attachment 54532 [details]
Bug fix.
Comment 2 Anton Leherbauer CLA 2006-11-27 03:13:50 EST
Your fix removes the resolution of symlinks completely. Maybe this should still be used as fallback?
Comment 3 Sergey Prigogin CLA 2006-11-27 12:16:59 EST
The code that supposedly did resolution of symlinks looked completely bogus to me. Do you think it can do something useful?
Comment 4 Anton Leherbauer CLA 2006-11-28 03:21:57 EST
The code comes from a patch for bug 102622 to filter out duplicate pathes. I think this is still relevant. Maybe you can change your patch such that it tries to find a workspace resource using the canonicalized path when there was no match with the original path?
Comment 5 Sergey Prigogin CLA 2006-12-09 21:41:53 EST
I tested my patch in a scenario from bug 102622. Everything works just fine due to cleverness of IWorkspaceRoot.findFilesForLocation method.
Comment 6 Anton Leherbauer CLA 2006-12-11 03:17:23 EST
Created attachment 55379 [details]
Slightly modified patch for release

You are right, IWorkspaceRoot.findFilesForLocation already canonicalizes the path. 
I have made some changes to your patch, e.g. to check for absolute includes. Please review if this is OK for you.
Comment 7 Anton Leherbauer CLA 2006-12-11 03:23:49 EST
Created attachment 55381 [details]
Modified patch

Sorry, the previous patch was the wrong one.
Comment 8 Sergey Prigogin CLA 2006-12-11 14:14:02 EST
Your patch looks good. Thank you for doing it.
Comment 9 Anton Leherbauer CLA 2006-12-12 02:33:23 EST
Committed to HEAD. Available in builds > 20061212.