Author |
Topic |
|
LarryLeonard
Tomato Guru
USA
1041 Posts |
Posted - Dec 10 2003 : 11:13:28 AM
|
I so rarely have an idea for a new feature... Okay, let's say I'm typing along, and I enter a method name:
Generic::SpinTheMessageLoop(
Now, VA wonderfully shows me the signature of this method as a tooltip:
UINT Generic::SpinTheMessageLoop(
bool bNoDrawing = false,
bool bOnlyDrawing = false,
UINT uiMsgAllowed = WM_NULL)
This is great, but what would be really useful is if I could type Ctrl-Alt-Shift-Z or something, and the arguments would be pasted into the source window in the format shown below at the cursor! Then, I wouldn't have to type in all those variable names myself (because I always comment the variable names when passing booleans and such - doesn't everyone?):
Generic::SpinTheMessageLoop(
/* bNoDrawing */ false,
/* bOnlyDrawing */ false,
/* uiMsgAllowed */ WM_NULL);
Whaddaya think? |
|
Stephen
Tomato Guru
United Kingdom
781 Posts |
Posted - Dec 10 2003 : 12:19:06 PM
|
It seems to me to depend too much on your particular coding style. |
Stephen Turner ClickTracks http://www.clicktracks.com/ Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
|
|
|
LarryLeonard
Tomato Guru
USA
1041 Posts |
Posted - Dec 10 2003 : 12:36:51 PM
|
I'm not clear why you say that; because of the commented argument names, I think?
If that's your objection, how about a simpler implementation: just paste the signature in, and let me do the rest myself. Here's a generic example: if the signature is:
type0 MyClass::MyMethod(type1 var1, type2 var2, type3 var3 = default3);
... then what I would want pasted after I type MyMethod( and hit Ctrl-Alt-Shift-Z would be everything inside the parenthesis:
MyMethod(type1 var1, type2 var2, type3 var3 = default3)
From there, I can (with VA's help) easily delete the types and comment the variable names.
|
|
|
Uniwares
Tomato Guru
Portugal
2322 Posts |
Posted - Dec 10 2003 : 2:23:08 PM
|
Sorry, maybe i misunderstand you, but since some version in VA6 you could do this. It was suggesting the whole parameter slew of the function when you wrote the implementation. |
|
|
LarryLeonard
Tomato Guru
USA
1041 Posts |
Posted - Dec 10 2003 : 2:29:10 PM
|
Say what? I've never heard of that. So, after I type in MyMethod(, what keystroke is it that will paste in all the arguments? Not just make them appear as a tooltip, actually paste them into the source code window? |
|
|
Uniwares
Tomato Guru
Portugal
2322 Posts |
Posted - Dec 10 2003 : 2:41:03 PM
|
It pops up as suggestion and you insert it with Enter Works fine for me (at least it did in VA6, have yet to try if it still works in VA X). |
|
|
LarryLeonard
Tomato Guru
USA
1041 Posts |
Posted - Dec 10 2003 : 3:03:29 PM
|
Maybe you're talking about .NET? Because I sure can't see how to do this in VC6...
(Although, VAX's "Suggest bits of code" seems to almost do what I want...) |
|
|
Uniwares
Tomato Guru
Portugal
2322 Posts |
Posted - Dec 10 2003 : 3:40:29 PM
|
Nope, not .NET - VS6
When you first declare a function, and then write the implementation, it will suggest the parameters as they are declared. |
|
|
LarryLeonard
Tomato Guru
USA
1041 Posts |
Posted - Dec 10 2003 : 3:48:03 PM
|
Ah, I see what you're talking about. When you define the function, yup, it sure does suggest the parameters. I never knew it did that - thanks!
But what I'm talking about is the same thing, but when you call the function, not just when you define it.
|
|
|
Uniwares
Tomato Guru
Portugal
2322 Posts |
Posted - Dec 10 2003 : 3:54:49 PM
|
quote: Originally posted by LarryLeonard
But what I'm talking about is the same thing, but when you call the function, not just when you define it.
Hmm, not sure why someone would want that. The variables used for parameters usually have not the same name, so what good would it do? You'll have to change it anyway.
Probably I didnt understand your idea. |
|
|
|
Topic |
|