Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347809 - The content assist does not propose class members declared below cursor for header file
Summary: The content assist does not propose class members declared below cursor for h...
Status: RESOLVED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: RDT (show other bugs)
Version: 4.0.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-31 10:59 EDT by John Liu CLA
Modified: 2011-06-06 13:54 EDT (History)
1 user (show)

See Also:


Attachments
the fix patch (2.05 KB, text/plain)
2011-05-31 11:36 EDT, John Liu CLA
no flags Details
Ops wrong file was attached, this is the right one. (1.26 KB, text/plain)
2011-05-31 11:44 EDT, John Liu CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Liu CLA 2011-05-31 10:59:16 EDT
If a content assist is triggered from a header file, the class members declared below cursor in header file won't be able to resolved.
Comment 1 John Liu CLA 2011-05-31 11:12:35 EDT
The problem happens when the class, which the content assist tried to resolve, is defined in a header file rather than in a source file. 

This is because when PDOMLinkage looks for the pdom file of a ITypedef binding, it only searches source file, so the class can't be resolved, therefore the content assist proposal won't be able to contain it.
Comment 2 John Liu CLA 2011-05-31 11:21:05 EDT
(In reply to comment #1)
> The problem happens when the class, which the content assist tried to resolve,
> is defined in a header file rather than in a source file. 
> This is because when PDOMLinkage looks for the pdom file of a ITypedef binding,
> it only searches source file, so the class can't be resolved, therefore the
> content assist proposal won't be able to contain it.

Also only the header file, in which content assist is triggered, can't be resolved properly. Other header files can be recolved from the project index.
Comment 3 John Liu CLA 2011-05-31 11:36:24 EDT
Created attachment 196991 [details]
the fix patch

The fix is in the function of getCompletionNode in TranslationUnit, in which we treat a header file as a source file, so its type definition can be resolved. 
This won't affect the project index and content assist result, as getCompletionNode runs in fly when the contenet assist is triggered and its parsed output is not saved in the index.
Comment 4 John Liu CLA 2011-05-31 11:44:33 EDT
Created attachment 196992 [details]
Ops wrong file was attached, this is the right one.
Comment 5 Chris Recoskie CLA 2011-06-01 15:23:09 EDT
Patch seems ok to me.
Comment 6 John Liu CLA 2011-06-01 16:18:09 EDT
Thanks Chris. The fix patch is committed into ptp_4_0 and HEAD.
Comment 7 John Liu CLA 2011-06-06 13:53:21 EDT
Fix in HEAD and ptp_4_0
Comment 8 John Liu CLA 2011-06-06 13:54:39 EDT
Fix in HEAD and ptp_4_0