Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333615 - Code completion inserting () after function name complete needs a user-preference
Summary: Code completion inserting () after function name complete needs a user-prefer...
Status: RESOLVED WONTFIX
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: 8.0   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Anton Leherbauer CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-05 20:35 EST by timecop CLA
Modified: 2017-04-08 15:18 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description timecop CLA 2011-01-05 20:35:16 EST
Build Identifier: Build id: 20100917-0705

When writing code in CDT editor, consider the following:

void fooBarBaz(int a, int b);
void barBazFoo(void);

int main(void)
{
  // start typing fooBarBaz function name here:
  foo<ctrl+Space>
  // it will auto-fill the entire function, such as
  fooBarBaz() // placing the cursor at the end of )
}

What I'm requesting is a user pref, similar to the "Typing" pref that auto-inserts closing ", ), } etc, to disable this auto-insertion of args.
Completing a function name is fine, but don't touch my parenthesis.

So correct behavior with this pref turned off with previous example would be:
1) type foo+ctrlSpace
2) it completes to fooBarBaz with cursor at the end.


Reproducible: Always

Steps to Reproduce:
1. Install eclipse
2. Install CDT
3. Follow the steps in Description to add a function name with content assist.
Comment 1 Nathan Ridge CLA 2016-12-29 18:40:14 EST
Can you give an example of a situation where a parenthesis isn't desirable?

I can think of two situations:

  - There is already a parenthesis after the cursor.
    This is something we can detect, and not insert the parenthesis
    in that case. 
    Bug 72391 tracks this.

  - You are passing a pointer to the function.
    This is also something we can detect in many cases, and
    not insert the parenthesis.
    Bug 496563 tracks this.

Anything else? I don't think the above two cases are sufficient motivation for a prefernce, since we can figure out the desirable behaviour in most cases.
Comment 2 Nathan Ridge CLA 2017-04-08 15:18:08 EDT
Closing as WONTFIX per comment 1.