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.
Created attachment 153871 [details] Empty Code Completion As you can see it in my little screencast, when I don't have typed any character and I hit Ctrl + Space, the code completion seems empty. I only see the arguments inside my main function to get access and some templates I think. This I not correct I think because in each other language I can hit ctrl + space without having typed any character and I got the whole list from a-zA-Z what I can use of functions, variables, consts, etc. Code completion only works, after hitting m -> malloc,.... or pr -> printf.... and whatever. Regards Chris
First of all, there are two completions: one you get by pressing Ctrl+Space, another by pressing Ctrl+Space+Space. The first one tries to show as small amount of symbols as possible, the second one is a full completion. But please note, when you have no prefix (i.e. you haven't typed anything) the full completion (Ctrl+Space+Space) will contain only symbols from your project and only a subset of symbols from libraries. This is because on big projects if full completion included all symbols from everywhere it would be enormous. The question is - does Ctrl+Space+Space fix your troubles with usability of completion? Thanks, Petr
What I expect, when I hit ctrl + space, is the same as inside a PHP file. I got a whole list of everything what is possible. For C/C++ project, I don't have it. Whether I type ctrl + space or Ctrl + space + space. For the second one C+S+S, I only see one more method and this is the method main where I'm inside.
Well, this is what I said - if you have no prefix even full completion will not show everything from libraries (stdlib in your case). For now it is expected behavior and it works as designed. Maybe we can alter it under a dedicated flag (like -J-Dcnd.completion.show.everything=true), but this most likely will not be the standard behavior.
Ok, but why was this so designed? I mean, you can say the same for PHP after include/require a lot of libs or the same for JAVA if you import a lot of whatever. But no I DON'T type anything and hit ctrl+space I got everything what I want, why not in c/c++? In my case, I would expect I see everything inside: stdio.h and stdlib.h but no, nothing. Neither after hitting ctrl+space nor ctrl+space+space.
I think it is so because completion with everything in it is useless. It should help you to write code, shouldn't it? If it is enormous you will spend to much time seeking for the right method/class/etc. The only use case I see is to investigate what is in libraries and project, but this doesn't seem to me like the easiest way to do that. What is your use case? Why do you need to have all symbols from standard library in completion?
You are totally right and I agree with your, that there is really not a normal use case for doing this. I just wondered, because I don't know this behaviour. I expected the same behaviour as in other project types, because in JAVA, you can test it, this behaviour is still possible. Sometimes, not often I only want to have an overview, what can I do and what are all the options and functions. But this is not very often. So I thought only that this is an inconsistent behaviour because in PHP, JS, CSS, HTML, JAVA the exact behaviour that EVERYTHING comes up, is possible after hitting ctrl + space without a character at the starting point. And I think that CLion, the IDE from IntelliJ, did the same. I didn't test it yet, but I will so maybe I'm false :) Regards Chris
(In reply to ChrisLE from comment #6) > You are totally right and I agree with your, that there is really not a > normal use case for doing this. I just wondered, because I don't know this > behaviour. I expected the same behaviour as in other project types, because > in JAVA, you can test it, this behaviour is still possible. Sometimes, not > often I only want to have an overview, what can I do and what are all the > options and functions. But this is not very often. So I thought only that > this is an inconsistent behaviour because in PHP, JS, CSS, HTML, JAVA the > exact behaviour that EVERYTHING comes up, We did it intentionally for C++ to be more responsive then other languages when handling huge source bases like Mozilla, LLVM, Boost,... > is possible after hitting ctrl + > space without a character at the starting point. And I think that CLion, the > IDE from IntelliJ, did the same. I didn't test it yet, but I will so maybe > I'm false :) 16G RAM is not enough for this IDE to open i.e. Mozilla sources. The current state - it is slow, although looks pretty nice.
So, as I said CLion does it as expected. Didn't test the mozilla source and I will give you right. I have a proposal, what about an option with a warning? So option is default empty (Checkbox for example) label is Code completion without typing a character or whatever and a warning: Be careful when you want to use this option and a biiiiig source for example mozilla, that this will break your machine or so (OutOfMemory). You know what I mean.