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.
[dev build #200506211800; jdk1.4.2 and 1.5] Code completion used to show constructor list when the object name with left round bracket was typed. Now the code completion shows list of some methods and packages - see attached screenshot.
Created attachment 22836 [details] Screenshot attached...
*** Issue 60807 has been marked as a duplicate of this issue. ***
We should fix it to NB 4.2
It is designed behaviour. (Alt+P is dedicated for parameters - but it doesn't support javadoc pane - issue #60807) Anyway, it needs to be discussed yet, leaving as open... Problematic code: (commenting pushExp... should solve the problem of this issue) http://java.netbeans.org/source/browse/java/editor/lib/src/org/netbeans/editor/ext/java/JCTokenProcessor.java?r1=1.5&r2=1.6
This issue was opened on nbusers as well. Pasting suggestions from users: -----------------%<----------------- I think we're going about this all wrong. I think we're trying too hard to emulate other IDEs and there is a cleaner approach. Here is my proposal: 1) User types new Font(<ctrl-space> 2) Code-complete brings up a list of possible constructors 3) User chooses one 4) IDE now shows code-complete containing all visible variables (which is what today's code does) so the user can fill in the constructor arguments. 5) Now, here is the kicker... in step #4, the user is able to see the ALT-P view on top of the code complete window. That is, he sees a small tooltip with the constructor he has chosen, its arguments and the current argument he is on (bolded). Below it, he sees a code-complete window with possible variables/fields that can be used for the current argument. 6) If the user changes their mind and they want an alternate constructor, they move the cursor back to "new Font(" and hit code-complete again. Hitting code-complete right after the braces will always allow you to choose from the list of available constructors. I don't think users should have to alternate between ALT-P and CTRL-SPACE. Code complete is code complete. We just need to make the current implementation more context-aware. Sorta like I should be able to invoke "Tools | Synchronize" inside an anonymous class and it should be smart enough to know that I am refering to the anonymous class, not to the outer class (as it current does). What do you think? -----------------%<-----------------
See also relevant issue 51669 which is about automatic filling in of parameters in methods.
I think this is not behaving correctly also. It is very difficult for a user to get Javadoc for a constructor. ie, Font fn = new Font(|); won't produce any javadoc upon Ctrl+Shift+Space (you'll get 'Javadoc not found' info), you can only get the list of parametrs via Atl+P. Font fn = new Font("aa", 0, 1|1); Ctrl+Shift+Space won't produce anything. On the other hand, this: Font fn = new Font|("aa", 0, 11); produces proper JavaDoc for the constructor. [050801 build from cvs]
Reopened on nbusers: -------------------%<--------------------- I'm testing new geatures in nb42 and have this situation: FileInputStream fis = new FileInputStream(|); When I press CTRL-SPACE Code Completition is show (see images). In 4.1 I now what constructors have FileInputStream, but in 4.2 I have no idea. My question is - How can I see constructors in 4.2? -------------------%<--------------------- We need to fix this, because the issue removes very useful functionality from code completion a lot of people are used to. It was raised by several other QE people as well. Thanks!
Discoverability of this feature (ALT+P) is in my opinion very poor. Would it be possible to auto popup the parameters window by default without necessity to press the shortcut ? To be honest I rather prefer the old way anyway ...
In addition, even after pressing Alt-P, the code completion isn't as good as before - it used to give the full javadoc for the constructors; now it only lists them.
I've seen the usability study yesterday, nobody found the Alt-P shortuct. People were complaining that they would like to see javadoc for constructors, but it's not possible. They were trying to press Alt-space to get it. We should address this soon, because it can mean UI changes.
Note also, completion does not show the correct parameters - i.e., type new Str[ctrl-space], and the completion you get is String(java.lang) whatever that means. I often invoke it on some class because I forgot the order of constructor parameters; this doesn't help.
Thanks for the feedback. We propose to modify the present CC behavior and insert the constructors' completion items into the completion result list in case the caret is after '(' or ',' in the constructor "new XXX(" call. The present parameter's tooltip would not be shown by default (it could still be shown explicitly by Alt-P) and the completion's window would remain open after the opening '(' in the constructor's call. The constuctor's parameter being typed would be shown in bold. The methods would work in a similar way. The completion items should be distinguishable from the rest of the items (Jano R. is working on that from the UI point of view). This should cover both the missing possibility of showing of the constructors' javadocs and decrease the importance if the user does not discover the Alt-P shortcut.
Fixed in trunk: Checking in lib/src/org/netbeans/editor/ext/java/JCTokenProcessor.java; /cvs/java/editor/lib/src/org/netbeans/editor/ext/java/JCTokenProcessor.java,v <-- JCTokenProcessor.java new revision: 1.7; previous revision: 1.6 done Checking in lib/src/org/netbeans/editor/ext/java/JavaCompletionQuery.java; /cvs/java/editor/lib/src/org/netbeans/editor/ext/java/JavaCompletionQuery.java,v <-- JavaCompletionQuery.java new revision: 1.5; previous revision: 1.4 done Checking in src/org/netbeans/modules/editor/java/JavaCompletionProvider.java; /cvs/java/editor/src/org/netbeans/modules/editor/java/JavaCompletionProvider.java,v <-- JavaCompletionProvider.java new revision: 1.6; previous revision: 1.5 done Checking in src/org/netbeans/modules/editor/java/NbJMIPaintComponent.java; /cvs/java/editor/src/org/netbeans/modules/editor/java/NbJMIPaintComponent.java,v <-- NbJMIPaintComponent.java new revision: 1.8; previous revision: 1.7 done Checking in src/org/netbeans/modules/editor/java/NbJMIResultItem.java; /cvs/java/editor/src/org/netbeans/modules/editor/java/NbJMIResultItem.java,v <-- NbJMIResultItem.java new revision: 1.18; previous revision: 1.17 done Checking in src/org/netbeans/modules/editor/java/NbJavaJMICompletionQuery.java; /cvs/java/editor/src/org/netbeans/modules/editor/java/NbJavaJMICompletionQuery.java,v <-- NbJavaJMICompletionQuery.java new revision: 1.11; previous revision: 1.10
It is not fixed. I type new File(. Then push Ctrl+Space and enter the suggested constructor. It deletes the left parenthesis so "new File)" is the result. [daily build #200508311800]
I have filed a separate P2 issue 63651 for eating of backets. Marking this one as fixed, it is now possible to display different constructors, their parameters and javadocs. It works for methods, too. Filling in by pressing enter doesn't work yet, but that will be tracked in issue 63651. There is another newly introduced P2 issue 63649 which seems to be related with this fix.
Please also check issue #61884. I'm not sure if it's a duplicate or not.
*** Issue 61884 has been marked as a duplicate of this issue. ***
Verified in dev build #200509210657. The cc correctly shows constructor types on the top.