Bug 318569 - Auto completion adds the parameters of a method even if they are already there
Summary: Auto completion adds the parameters of a method even if they are already there
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: 3.7 M1   Edit
Assignee: Ayushman Jain CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-01 05:40 EDT by Lars Svensson CLA
Modified: 2010-08-03 05:17 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 Lars Svensson CLA 2010-07-01 05:40:49 EDT
Build Identifier: 

If the cursor is at the end of a method call and auto completion is used (Ctrl+space)and a method is chosen, the parameters is also typed even if there is parameters starting with '(' to the right of the cursor. Would like to be able to switch this behaviour off. 

Reproducible: Always

Steps to Reproduce:
1.Type: 
String value = System.getProperty("key", "MyDefinition");
2. Set the cursor after 'y' in getProperty, and delete the last 'y'. Using Ctrl-Space select the same method again.
3. The text will read:
String value = System.getProperty(key, def)("key", "MyDefinition");

I would like the parameters to not be written again if there is a Start parantheses at the right of the insertion.
Comment 1 Ayushman Jain CLA 2010-07-01 06:11:49 EDT
Lars, I dont understand the use case here. Why would somebody want to use content assist, when he has typed the entire thing, including parameter names, already?! The purpose of content assist is to save the users from typing all that which eclipse can automatically type for them.

Olivier/Srikanth, what is your take on this?
Comment 2 Srikanth Sankaran CLA 2010-07-01 09:41:42 EDT
(In reply to comment #1)
> Lars, I dont understand the use case here. Why would somebody want to use
> content assist, when he has typed the entire thing, including parameter names,
> already?! The purpose of content assist is to save the users from typing all
> that which eclipse can automatically type for them.
> 
> Olivier/Srikanth, what is your take on this?

I think this behavior is controlled by Window + Preferences + Java + Editor + Content assist + Completion inserts vs overwrites setting ?
Comment 3 Lars Svensson CLA 2010-07-01 10:18:05 EDT
(In reply to comment #2)
> (In reply to comment #1)
> > Lars, I dont understand the use case here. Why would somebody want to use
> > content assist, when he has typed the entire thing, including parameter names,
> > already?! The purpose of content assist is to save the users from typing all
> > that which eclipse can automatically type for them.
> > 
> > Olivier/Srikanth, what is your take on this?
> I think this behavior is controlled by Window + Preferences + Java + Editor +
> Content assist + Completion inserts vs overwrites setting ?

First things first... "Overwrites settings" is exactly the functionallity I was looking for... Thank you.. Case closed!

And to satisfy your curiosity. I always get this in code like:

node.getUp(node.geName());

..and then I want to make this call three times more, but change a little. I want this:

node.getRight(node.geName());
node.getDown(node.geName());
node.getUp(node.geName());


So I copy/paste:
node.get(node.geName());
node.get(node.geName());
node.get(node.geName());
..and use auto completion after 't' in get. Then I got this unwanted behaviour. But not anymore..:-)
Comment 4 Srikanth Sankaran CLA 2010-07-02 00:37:57 EDT
(In reply to comment #3)

> And to satisfy your curiosity. I always get this in code like:

Thanks. Closing as WORKSFORME.
Comment 5 Srikanth Sankaran CLA 2010-08-03 05:17:22 EDT
Verified for 3.7 M1 using build I20100802-1800