I wish there could be a Xcode like code completion.
For instance, if I type p, Xcode shows printf, perror ... functions or variables start with p.
In NetBeans, I have to use Ctrl+Space or :: trigger.
Also, if I type ::p, code completion won't show up, I have to type ::, wait for 0.5 seconds to type p, hope this can be
thanks for request
Created attachment 92464 [details]
code completion after key stroke
I have made some changes to code completion module and testes myself.
Now code completion shows up after every key stroke other than ") ; }", these three chars often indicate an end of statement.
Sorry that I am new to hg, do not know how to combine two change sets.
Also do not know how to hint after only one char is typed, eg 'p' -> printf, now hint only begins after at least two chars.
Could anybody kindly give comments and hint to some simple mercurial tutorial.
Thanks a lot.
Thanks for trying :-)
I think, we should be consistent with Java editor.
Java editor has a Code Completion option which allow to popup completion window on typing any character.
what do you think?
(In reply to comment #3)
> Thanks for trying :-)
> I think, we should be consistent with Java editor.
> Java editor has a Code Completion option which allow to popup completion window
> on typing any character.
> what do you think?
You meant the Popup on Typing Any Java Identifier Part option?
That would be nice but I don't see Xcode does that, maybe Visual Assist X does.
The difference between C/Java is that Java has much fewer hint candidates. C/C++ may have too many macro definitions, structure...etc, all in the global namespace.
If the list could be sorted in some way, like put function definition to the top of list(now it is behind structure and macros). Then hint at first character would more useful.
I found there is a CPP_AUTO_COMPLETION_TRIGGER in options/CodeCompletionPanel.java, cplusplus/CsmCompletionUtils.java but not used in cplusplus/ext/CompletionSupport.java:needShowCompletionOnText.
Is that the reason configuration in GUI does not change anything?
you are right, CPP_AUTO_COMPLETION_TRIGGER is not used.
But I was talking about analog of Java's "Auto Popup on Typing Any Java Identifier Part"
Can we decide what exactly you'd like to have (do not forget consistency with java) :-)
> The difference between C/Java is that Java has much fewer hint candidates.
> C/C++ may have too many macro definitions, structure...etc, all in the global
there are two modes of Code Completion lists. One is small and the second is full.
> If the list could be sorted in some way, like put function definition to the
> top of list(now it is behind structure and macros). Then hint at first
> character would more useful.
I agree that sorting could be better considering the current context where code completion is invoked. But can we define such rules?
Rules I think of so far,
1. hide #define macros unless they are defined in the same project, or have been used once on the project.
2. put functions at the top of list, then structures, then macros.
3. put whatever functions/macros/structures that have been used in the project at the top.
what about put local variables at the top of list, not functions?
(In reply to comment #9)
> what about put local variables at the top of list, not functions?
I think that pretty make sense.
1. local variable
2. variable/function in the same file
3. others from include headers.
sort by how close they are to the cursor, ;)