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 11576 - [completion] Java completion window should offer local variables where appropriate
Summary: [completion] Java completion window should offer local variables where approp...
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 3.x
Hardware: PC All
: P2 blocker with 1 vote (vote)
Assignee: Martin Roskanin
URL:
Keywords:
: 18888 43500 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-04-19 18:30 UTC by Miloslav Metelka
Modified: 2007-11-05 13:38 UTC (History)
6 users (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 Miloslav Metelka 2001-04-19 18:30:11 UTC
We should probably consider having an alternate icon for the local variables in 
the completion window.
Comment 1 Jan Chalupa 2001-05-05 21:57:39 UTC
Target milestone -> 3.3
Comment 2 David Konecny 2001-05-22 15:51:08 UTC
Changing the state of the issue to ASSIGNED, because it was cover in 
Requirements document at http://editor.netbeans.org/doc/Requirements.html
Comment 3 Jan Chalupa 2001-11-27 12:27:23 UTC
Target milestone -> 3.3.1.
Comment 4 Marek Grummich 2002-07-22 09:49:27 UTC
Set target milestone to TBD
Comment 5 Marek Grummich 2002-07-22 09:55:01 UTC
Set target milestone to TBD
Comment 6 Jiri Hana 2003-08-06 15:09:27 UTC
See similar issue: http://www.netbeans.org/issues/show_bug.cgi?id=27755
Comment 7 psuk 2004-03-23 19:15:45 UTC
Changing subcomponent to "code completion"

Comment 8 _ mihmax 2004-04-14 12:16:54 UTC
*** Issue 18888 has been marked as a duplicate of this issue. ***
Comment 9 _ mihmax 2004-04-14 12:17:09 UTC
Here are the extracts from other issues, filed for this functionality.

IMHO this is a high-priority issue, given the number of requests, and
the bad impact it does on NetBeans users: it urges them to write bad
code (see the last comment by Riyad Kalla)

And please, someone, evaluate this issue and change the Target
Milestone to something not TBD (which means "the issue hasn't been
evaluated yet").
 
----------------------------------------------------------------

Autocomplete should be worked also for local variables. Example

public void moin (int indexOfTestTableModel)
{
int workIndex;
.....
}

The variables 'indexOfTestTableModel' and 'workIndex' should be
detected. Also private members should be shown, if I have access to them.

// by Thomas Breitkreuz //


-------------------------------------------------

Copy from Issue 38947:

Reporter:  	rsk@netbeans.org (Riyad Kalla)
I would like to request that autocompletion for
local variables be added to the IDE. I am not
aware of ANY IDE that does NOT let you complete
local variables except for NetBeans. I'm not sure
how the lack of this has lasted so long except for
the fact that people might just be used to it.

Also, CTRL-L/K doesn't count, that's more of a
Emacs text-complete feature than it is an IDE feature.

Can someone shed some light as to why this doesn't
exist and how its gone so long without being
implemented?

I see the roadmap for 3.6 and 4.0, and while I see
a lot of IDE features, I don't see almost any
editing-specific features which is 90% of the work
a person does with an IDE.

// by Riyad Kalla //

--------------------------------------------------------

May I request a review of this rather useful and fundamental
coding-productivity functionality, please, why it's not there, and how
Java-MDR (in 4.0) may solve this issue?

// upon request by Sergey Kholobuda in nbdiscuss_ru@netbeans.org //

--------------------------------------------------------

I imagine the lack of this functionality stems from short commings 
in the autocomplete parser. Autocomplete accuracy, delay and 
intelligence in NetBeans 3.5.1 acts like a proof of concept when 
compared to the likes of Eclipse 3.x (and 2.x sort of) or IntelliJ 
3.x/4.x. 
 
// by Riyad Kalla //

---------------------------------------------------------

As a side note, I was working with a new developer this morning who  
uses NetBeans exclusively... and ever single one of his method-scope  
variables were 2 to 3 letter abbreviations. So it seems the lack of  
this feature really does effect how these developers are coding.  

// by Riyad Kalla //
Comment 10 Miloslav Metelka 2004-04-14 18:55:59 UTC
I think that this should rather be marked as a defect than an
enhancement. We should be able to address the problem into promoD.

One particular problem is accuracy of the parser for local variables -
currently it only searches for the two successive identifiers followed
by semicolon (or assignment or comma). It searches from the method
body opening brace but it does not watch for code blocks nesting so in
fact
"innerVar" variable would get displayed at the caret position in the
following example:

void m1() {
    ...
    {
        int innerVar;
        ...
    }
    ...
    |

}

Right now we are in the process of adapting the editor to new java/mdr
into promoD so rewriting portions of the completion against JMI
interfaces and other related changes are being done as well. We will
attempt to address this issue during this rewrite as well.
Comment 11 rsk 2004-04-14 19:10:16 UTC
Miloslav, 
Thank you for the update... is this rewrite planned for NetBeans 4? 
Or is this for a later release? 
 
I also agree with your assessment that it is a defect. Perhaps an 
enhancement in when it was opened, but certainly a defect now. 
Comment 12 Miloslav Metelka 2004-04-14 19:38:38 UTC
The java/mdr based code completion must certainly get ready into
promoD and the fix for this should be included. BTW the development is
done under meta_stavbicka cvs branch which should get merged into the
trunk soon.
Assigning to Martin.
Comment 13 Martin Roskanin 2004-05-19 09:10:14 UTC
*** Issue 43500 has been marked as a duplicate of this issue. ***
Comment 14 Dusan Balek 2004-06-14 09:49:54 UTC
Fixed in [maintrunk].
The new jmi/mdr based code completion shows local variables in the
completion window.
Comment 15 Roman Strobl 2004-12-23 15:40:32 UTC
Verified in 200412221900.