Snippets and auto-stubs

A few more tips for getting the most out of Visual Studio.
 
  • Snippets from Intellisense. When you start to type in the editor you’ll get the trusty intellisense drop down. If there is a snippet available then it also be shown, for example as you start to type t..r..y you’ll see the "try" snippet, but how do you invoke it. After much trial and error yuo need to double tab, i.e. with the try snippet highlighted press tab twice in quick succession
  • Auto-stubs. When you’re inside a function and you realise you have to going to have write another function and call it, then write the the call to the yet-to-exist function an you’ll see a little block appear under the new function name. Selecting that will automatically create the skeleton code for your new function using the arguments (and datatypes).
  • Auto-add "Using". If you add a call to a component you have referenced but don’t specific the full namespace and haven’t yet added it to the "using" statments then a little block will appear under the component. Selecting that will auto-create the correct "using" statement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s