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 252590 - Code completion is kind of empty after hitting ctrl + space
Summary: Code completion is kind of empty after hitting ctrl + space
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Completion (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: petrk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-26 11:41 UTC by Christian Lenz
Modified: 2015-09-28 11:01 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Empty Code Completion (231.33 KB, image/gif)
2015-05-26 11:41 UTC, Christian Lenz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Lenz 2015-05-26 11:41:04 UTC
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
Comment 1 petrk 2015-05-26 12:26:02 UTC
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
Comment 2 Christian Lenz 2015-05-26 12:42:06 UTC
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.
Comment 3 petrk 2015-05-26 12:59:15 UTC
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.
Comment 4 Christian Lenz 2015-05-26 14:05:17 UTC
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.
Comment 5 petrk 2015-05-27 10:58:55 UTC
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?
Comment 6 Christian Lenz 2015-05-28 14:33:19 UTC
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
Comment 7 Vladimir Voskresensky 2015-05-28 18:19:30 UTC
(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.
Comment 8 Christian Lenz 2015-06-01 19:41:05 UTC
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.