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 8156 - [completion] place matching types for rvalues at top of completion list
Summary: [completion] place matching types for rvalues at top of completion list
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 4.x
Hardware: PC All
: P4 enhancement with 8 votes (vote)
Assignee: issues@editor
URL:
Keywords:
: 37105 (view as bug list)
Depends on:
Blocks:
 
Reported: 2000-11-02 23:30 UTC by athompson
Modified: 2007-11-05 13:38 UTC (History)
4 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description athompson 2000-11-02 23:30:16 UTC
if the code being completed is an rvalue, it should be fairly straightfoward to
determine its type.  knowing this, how about eliminating those members which are
not the correct type and whose values cannot be implicitly cast as the correct
type.  for example:

java.awt.Point p=new java.awt.Point();
int x=p.       <--- code completion here

another example:

void foo(int i) {
	...
}
...
java.awt.Point p=new java.awt.Point();
foo(p. <--- code completion here


only three things should show up for these cases:
	p.x
	p.y
	p.hashCode()

it would make things so much easier.

2 thing to watch out for:
1. implicit casting - int's need to be included for doubles, child classes need
to be included for parents, etc.
2. explicit casting

thanks,
al
Comment 1 athompson 2000-11-02 23:40:59 UTC
*** Bug 8157 has been marked as a duplicate of this bug. ***
Comment 2 Svata Dedic 2000-11-03 06:39:59 UTC
What about another case:
int x = something.getAnotherObject().getValue()
                  <--------- code completion here
I would really not like the completion list to show int-typed fields and
methods, since I would not get getAnotherObject() that return AnotherObject
type. But again, they may be filters applicable to the completion list by e.g.
pressing some key and this may be one of them.
Comment 3 athompson 2000-11-03 07:17:59 UTC
good point.  let me suggest instead placing field/methods with matching types at
the top of the list.

thanks,
al
Comment 4 Jan Lahoda 2001-01-24 15:35:59 UTC
Only changed version to Development.
Comment 5 Jan Chalupa 2001-05-05 21:53:37 UTC
Target milestone -> 3.3
Comment 6 David Konecny 2001-06-18 13:45:07 UTC
Changing the state of the issue to ASSIGNED, because it was covered in 
Requirements document at http://editor.netbeans.org/doc/Requirements.html
Comment 7 Jan Chalupa 2001-11-27 12:27:41 UTC
Target milestone -> 3.3.1.
Comment 8 Marek Grummich 2002-07-22 09:48:41 UTC
Set target milestone to TBD
Comment 9 Marek Grummich 2002-07-22 09:53:26 UTC
Set target milestone to TBD
Comment 10 psuk 2004-03-23 19:15:30 UTC
Changing subcomponent to "code completion"

Comment 11 Martin Roskanin 2004-11-15 10:03:11 UTC
*** Issue 37105 has been marked as a duplicate of this issue. ***
Comment 12 athompson 2005-02-08 19:37:48 UTC
i still think it's a good idea. the other guys do it...
Comment 13 athompson 2005-02-18 19:29:51 UTC
this RFE is ancient! if you make this happen for 4.1, i promise i'll
never look at Eclipse again!  :P
Comment 14 Vitezslav Stejskal 2007-05-21 02:30:32 UTC
I believe this is covered by the smart code completion in Nb6. Dusane? Can we
closed this as fixed?
Comment 15 Dusan Balek 2007-05-21 09:44:23 UTC
Agree.
Comment 16 athompson 2007-05-21 14:21:37 UTC
yup. looking nicer by the build.