Summary: | Content assist fails due to lack of completion node | ||||||
---|---|---|---|---|---|---|---|
Product: | [Tools] CDT | Reporter: | Norbert Plött <norbert.ploett> | ||||
Component: | cdt-core | Assignee: | Bryan Wilkinson <bryan2233> | ||||
Status: | RESOLVED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | aleherb+eclipse, aniefer, bryan2233, john.camelon | ||||
Version: | 3.1 | Keywords: | contributed | ||||
Target Milestone: | 4.0 M5 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Norbert Plött
2006-07-20 07:37:14 EDT
Created attachment 57541 [details]
proposed patch
The source of the problem is actually the scanner for the GNUCPPSourceParser. Once the scanner reaches the last character to be processed for the completion it creates a COMPLETION token if it is in the process of scanning an identifier. If the parser looks past the COMPLETION token, it will only find EOC (End Of Completion) tokens.
The problem occurs if an identifier is not being scanned when the last character is reached. Then, an EOC token is returned. The GNUCPPCompletionParser, however, still requires a COMPLETION token to properly create a completion node. So simply returning a COMPLETION token instead should do the job.
A couple of small changes were also made in GNUCPPSourceParser to handle COMPLETION tokens during the parsing of base specifiers.
The patch fixes completion node creation (but not necessarily completion proposal generation) for the following cases:
- CompletionTest_ArgumentType_NoPrefix
- CompletionTest_ArgumentType_NoPrefix2
- CompletionTest_ClassReference_NoPrefix
- CompletionTest_ExceptionReference_NoPrefix
- CompletionTest_FieldType_NoPrefix
- CompletionTest_FieldType_NoPrefix2
- CompletionTest_NamespaceRef_NoPrefix
- CompletionTest_NewTypeReference_NoPrefix
- CompletionTest_SingleName_Method_NoPrefix
- CompletionTest_SingleName_NoPrefix
- CompletionTest_VariableType_NoPrefix
The following cases still do not produce completion nodes:
- CompletionTest_MacroRef_NoPrefix
- CompletionTest_MacroRef_Prefix
However, this is because the GNUCPPSourceParser is not responsible for preprocessor directives. In fact, there is no completion processing at all for preprocessor directives, which is another problem altogether.
Great! A tiny patch but a big step forward for code completion. I have applied the patch and updated the tests. Together with the patch for bug 169480 most of those tests actually succeed. (In reply to comment #3) > I have applied the patch and updated the tests. > Together with the patch for bug 169480 most of those tests actually succeed. This is _impressive_, and I am quite happy that my labor in preparing this report was not in vain ... Anton, will this be in 3.1.2? Although the patch is quite "harmless", I'd rather not given that 3.1.2 release date is not far ahead. |