This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 51669 - CC offers 1st parameter name in multiline method call
Summary: CC offers 1st parameter name in multiline method call
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker with 2 votes (vote)
Assignee: Dusan Balek
URL:
Keywords:
: 52092 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-11-19 10:54 UTC by zikmund
Modified: 2007-11-05 13:38 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zikmund 2004-11-19 10:54:14 UTC
Build 200411150946 (pre-RC1)

1) Have multine method call and invoke CC at
position '|':
      TestCall(|
            100000);
2) ERROR:
parameter name from method definition will be
completed:
      TestCall(index)
            100000);

I would expect only JavaDoc window opening.
Comment 1 Miloslav Metelka 2004-12-01 09:55:41 UTC
The problem is that instant substitution for the code completion is
not evaluating the context properly and it thinks that there are no
parameters filled in although there are some. The instant substitution
needs to work lexically instead of just evaluating whether there are
any characters till the end of the line.
The workaround can be to swith-off the "Code Completion Instant
Substitution" in Tools->Options->Editing->Editor Settings->Java Editor.
Comment 2 Dusan Balek 2004-12-06 14:34:44 UTC
*** Issue 52092 has been marked as a duplicate of this issue. ***
Comment 3 Roman Strobl 2005-03-11 12:26:58 UTC
Can we fix this issue in 4.1? It has 4 votes. If not, remove the status
whiteboard I've added. Thanks.
Comment 4 Dusan Balek 2005-03-15 15:42:54 UTC
For the next release, we plan to redesign the method parameters code completion
 so the method parameter names are no longer pasted directly to the text but
they are shown in a tooltip instead. This change should fix this issue.
Comment 5 randahl 2005-03-15 16:24:33 UTC
As a long time NetBeans user, I would like to comment on your plans to stop
pasting method parameter names into the source and show them in a tool tip. I
happen to feel the pasting of the parameter names are a great advantage. I use
long and meaningful parameter names like "customerId" or "paymentDate" and quite
often there is a perfect match between the local variable name and the invoked
method's parameter name, so when NetBeans pastes "customerID" I do not change
this name - rather I hit my left arrow key to accept the name NetBeans has
pasted for me. This is a very efficient way to invoke methods.

I strongly feel that the change you suggest will remove this efficient way of
typing parameter names. Of course, I do not know the details of your plan, but I
hope you will take this comment into account.

Randahl
Comment 6 Roman Strobl 2005-07-11 12:40:28 UTC
Pasting comments from nbusers:

----------------%<------------------
Prior to the latest qbuild NB would show the parameters of a method in the
Ctrl+Space list, and this has now been moved to Alt+p. I appreciate the new way
being much faster, but I miss one important feature: NB used to print a variable
name suggestion simply by typing the name of the method parameter, and this
feature is now gone it seems. For instance, if the class Car had this constructor

public Car(int registrationNumber) {}

then when typing

new Car(|

NB would fill in the default variable name "registrationNumber" - this was great
because quite often I had a local variable of exactly that name, so NB saved me
a lot of typing.

Since this featrue seems to have been lost, I would like to suggest that NB was
improved by allowing me to hit Alt+p a second time and get the parameter name
typed. I could work this way:

1. I type "new Car("
2. I press Alt+p and get a tool tip saying "int registrationNumber" with the
registrationNumber in bold
3. Knowing that i have a local variable of the same name which I would like to
use I press Alt+p A SECOND TIME
4. As a response to the second press NB prints "registrationNumber" for me

This could work for methods of more than one parameter as well simply by letting
each consecutive press of Alt+p type the next name (seperated by commas of course).

How about that?

Randahl

----------------%<------------------

even better: when the user types the ';', ')', or ',' characters before
typing a letter, you can assume the user simply wants to use the default
variable name and fill it in before the typed character. in other words,
whenever the user leaves an area which requires a value empty, fill it
in with the name from the prototype. 

----------------%<------------------

Please consider these suggestions before closing this issue.
Comment 7 Dusan Balek 2005-11-01 09:44:08 UTC
With the new code completion infrastructure, parameter names are no longer
automatically pasted. Closing as wontfix.