User forums > Using Code::Blocks

Can CB autocomplete function parameters from the prototype?

(1/2) > >>

kfs1:
You've defined your class, you're working thru the function list. You are about to define a member function. As you type it in, autocomplete helps you fill in the class name. Then it helps you fill in the function name, and then you type ( and it shows you the function parameters.

Is there a way at this point to get it to insert that info for you? (Other than going through the 'insert' menu, which I'm having problems with separately)

kingfox:
When u type (, the Code::Blocks will shows you the function parameters. It's the built function of C::B. Show as below:


[attachment deleted by admin]

orefa:
Oh wow, I've been enjoying code completion for a while but I didn't know it could also show function parameters until now. Reason is: I don't use the Enter key but just finish typing the function name out of habit, it's more natural (the list does help to confirm the correct function and spelling). But then, the opening parenthesis does not trigger the list of parameters. As I play with it now I see that if I erase the '(' and type it again then the list appears. This behaviour may be a glitch. Or maybe there's a reason for it...

kingfox:

--- Quote from: orefa on November 23, 2006, 02:38:03 pm ---... ...But then, the opening parenthesis does not trigger the list of parameters. As I play with it now I see that if I erase the '(' and type it again then the list appears. This behaviour may be a glitch. Or maybe there's a reason for it...

--- End quote ---

I think maybe your typing speed is too fast, so C::B's code completion function can't follow your speed with default settings. You can adjust the delay of code completion as followed figure:


[attachment deleted by admin]

orefa:
Thanks kingfox, but that's not it. The setting was at 500, I reduced it to 0 and the problem remains. It seems that any speed setting I can type "CreateCursor" for example and the list of functions remains visible while I pause for a few seconds. As soon as I type the '(' the list of function names disappears but the list of function parameters does not appear. I pause for a few seconds again, backspace over the '(', pause for a few seconds again, type '(' a second time and the list of parameters finally appears.

Another way to make it appear is to type "CreateCursor" and press a redundant 'Enter' to dismiss the list before typing the '('. It feels like code completion expects you to take some sort of action before it shows you the parameters. Maybe it is intended, as in "if you don't purposely ask for the parameter list you won't get it" but that is a different behaviour from the list of functions. Or maybe this is specific to Windows 2000. Can anyone else confirm this?

Navigation

[0] Message Index

[#] Next page

Go to full version