Welcome to MSDN Blogs Sign in | Join | Help

Sara Ford's WebLog


My adventures embracing open source on CodePlex and at Microsoft

News

Cool new little Editor feature in the Dec CTP – Edit.PasteParameterTip

It’s really the simple things in life.  Ever had a long list of parameters for a method and didn’t want to have to look down at the tooltip to know where you were at in this list?  Check out Edit.PasteParameterTip.  Under the General Development Settings, it is mapped to Ctrl+Alt+Shift+P, but you can change this to whatever you want under Tools – Options – Keyboard.

 

For example, suppose the method Foo below contained 4 or 5 parameters.

 

this.Foo(

 

Leaving the cursor right after the open parenthesis (and the tooltip showing), hit Ctrl+Alt+Shift+P.  Results…

 

this.Foo( int i, string j, int k, string l, int m, string n )    

 

Now you can just update the parameters with your variables without having to follow along with the tooltip.

 

update 1/21/2005 - 2:30pm

By the way, there's a corresponding Edit.CopyParameterTip Ctrl+Alt+Shift+C.  Forgot to mention earlier.

Posted: Friday, January 21, 2005 1:13 PM by saraford
Filed under:

Comments

KevMar said:

Thanks for the tip. I know I will find that handy.
# January 21, 2005 2:15 PM

Issam Elbaytam said:

I wish you would comment out the types so the pasted code syntax is correct. Typically, i name my args with the same names as the params and this would be helpful. In your example, first thing I would have to do is remove the param types.
# January 22, 2005 3:00 AM

David van Leerdam said:

It would be even more useful (and not less readable) if it got pasted in this format:

this.Foo( (int) i, (string) j, (int) k, (string) l, (int) m, (string) n )
# January 24, 2005 12:00 PM

Alex said:

I disagree you shouldn't put (int) i,(string) j etc... in because that would give valid but superfluous code. Personally I'd prefer:

foo(int1, string1, int2, string2, int3, string3)

Which leaves you in no doubt as to what the parameters are, gives you less to delete and if if you are particulary lazy is actually valid code.
# January 25, 2005 12:28 AM

Mickey Gousset said:

OK, that is just too cool! Thanks!
# January 25, 2005 5:33 AM

Juan Ignacio Gelos said:

How about (int_paramName1, string_paramName2, ...), and make each one an editable field like when you use an expansion code snippet, so we can Tab through and replace them?

Now *that* would be nice.
# January 26, 2005 11:32 AM

Keith Hill said:

Neat feature but needs a better kbd shortcut. I really like what the C# team has done with kbd shortcuts by taking advantage of chorded kbd shortcuts. This feature could use a shortcut like Ctrl+K, Ctrl+H or something akin to that. Check with Anson Horton. I think he took over the keybindings.
# January 26, 2005 2:27 PM
New Comments to this post are disabled
Page view tracker