Bug 172204

Summary: Extra/missing parameter hint proposals
Product: [Tools] CDT Reporter: Bryan Wilkinson <bryan2233>
Component: cdt-coreAssignee: Bryan Wilkinson <bryan2233>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 Keywords: contributed
Version: 4.0   
Target Milestone: 4.0 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch to LegacyCompletionProposalComputer bjorn.freeman-benson: iplog+

Description Bryan Wilkinson CLA 2007-01-30 13:41:54 EST
Computing context information for parameter hints by pressing CTRL-SHFT-Space between the parentheses of a function call or a function style macro can result in extra or missing proposals.

Example:

    void foo();
    void foo(int i);
    void fog(int i, int j);

    void bar() {
        foo(//CTRL-SHFT-Space (1)
        foo  (//CTTL-SHFT-Space (2)

In case (1), only foo() and foo(int i) should be listed, but fog(int i, int j) is listed as well.

In case (2), foo() and foo(int i) should be listed, but there are no results.  Note that there are two spaces separating “foo” and the left parenthesis.
Comment 1 Bryan Wilkinson CLA 2007-01-30 13:53:26 EST
Created attachment 57830 [details]
patch to LegacyCompletionProposalComputer

The LegacyCompletionProposalComputer generates context information inside the parentheses of a function by reusing content assist before the parentheses of the function.  So, it needs to calculate a new offset for the code completion.

This patch fixes the calculation of the new offset, which was off by one and didn't handle whitespace.
Comment 2 Anton Leherbauer CLA 2007-01-31 03:49:56 EST
Good catch!
Comment 3 Anton Leherbauer CLA 2007-01-31 04:00:14 EST
Patch applied. Thanks, Bryan.