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 140042 - Code completion: subclasses should be shown as smart types (above the line)
Summary: Code completion: subclasses should be shown as smart types (above the line)
Status: VERIFIED DUPLICATE of bug 122154
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: David Strupl
URL:
Keywords:
Depends on:
Blocks: 146952
  Show dependency tree
 
Reported: 2008-07-15 11:38 UTC by Alexandr Scherbatiy
Modified: 2008-10-31 10:41 UTC (History)
0 users

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 Alexandr Scherbatiy 2008-07-15 11:38:33 UTC
Steps to reproduce:
- Create a JavaFX Script file:
-----------------------------------------------------------
import javafx.animation.*;
import javafx.scene.Group;
import javafx.scene.geometry.*;


var group = Group{
        content: [ ] 
}
-----------------------------------------------------------

- Move cursor to the 'content: []' line
   content: [ ]
             ^
- Press <Ctrl+Space>
  The code completion suggests 'javafx.animation.KeyFrame' and others files 
  that do not subclass the Node type.
Comment 1 David Strupl 2008-07-15 12:29:01 UTC
The behaviour is fine. You cannot restrict the code completion to the types that are assignable to the type of the
expression. The user can continue typing and thus we have to offer anything that can potentially be prefix of what can
be typed in there.

Take for example this

var a : Number = 

According to your argment only Numbers should be suggested but if the user types e.g.

var a : Number = Group{}.anchorX;

You get perfectly fine code. So we suggest even Group after the =.

Also please note that the code completion should use so called "smart" types - it is the values above the line in the
code completion list. These are the ones that have the matching type according to the type of the expression. We suggest
them first but that is all we can do.
Comment 2 Alexandr Scherbatiy 2008-07-15 12:37:44 UTC
Then the problem is that smart javafx.scene.geometry classes 
and javafx.animation classes are mixed for the sample.

Should the classes that subclass Node be above the line in the
code completion list in this case?
Comment 3 Alexandr Scherbatiy 2008-07-15 12:39:18 UTC
Should the smart subclasses  be above the line in the code completion list?
Comment 4 David Strupl 2008-07-15 12:42:40 UTC
I think yes. I mean the smart types (classes) should be above the line, so all subclasses of Node should be above the
line. I am changing the summary of the bug report to reflect this.
Comment 5 David Strupl 2008-10-29 14:08:32 UTC
Moving this to post 1.0.
Comment 6 David Strupl 2008-10-30 14:47:50 UTC

*** This issue has been marked as a duplicate of 122154 ***
Comment 7 Alexandr Scherbatiy 2008-10-31 10:41:54 UTC
verified