Snippet in Visual Studio to create static method

After using Textmate for a couple of weeks I’ve come to realise how incredibly powerful and beautiful it is! Creating text snippets is a breeze – and improves productivity no end!

To achieve the same affect in Visual Studio though is a right pain in the butt-ocks. All I wanted to do was create a very basic snippet to define a static method (because I was creating a bunch of them all at the same time) and had to get down and dirty with some XML.

Anyhoo – here’s my result:


  
  
  
Public Static Method Declaration pubs Code snippet for creating a static method Chris O'Sullivan Expansion
return_type Return Type void method_name Method Name method param_type Param Type param_type param Name of Param param
Then you just type pubs[tab] and it will create a declation like this:
public static void method(param_type param)
{
}

With the ability to tab between the different fields.

But oh man what a pain that was to do! (I love you textmate – xx)