Bug 172204 - Extra/missing parameter hint proposals
Summary: Extra/missing parameter hint proposals
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 4.0 M5   Edit
Assignee: Bryan Wilkinson CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-01-30 13:41 EST by Bryan Wilkinson CLA
Modified: 2009-01-09 15:09 EST (History)
0 users

See Also:


Attachments
patch to LegacyCompletionProposalComputer (1.71 KB, patch)
2007-01-30 13:53 EST, Bryan Wilkinson 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 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.