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.
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.
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.
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?
Should the smart subclasses be above the line in the code completion list?
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.
Moving this to post 1.0.
*** This issue has been marked as a duplicate of 122154 ***
verified