A few months ago, I found an issue when working with Whidbey Beta 2. I posted some
product feedback about it, but never got around to posting a follow up entry here.
The problem I encountered was when I entered comments at the end of blocks of code. At the end of End If, Select statements etc, I like to add comments to indicate what the block of code was about. It makes following code really easy, especially when there are many nested code blocks. At the end of the statement, I press Tab + ' + Space and then enter my comment.
Whidbey has support for snippets (which are really great BTW), but they were tripping me up in this case. One of the ways that snippets work is that the IDE looks at what has been typed before a tab character to see if it represents a snippet shortcut. If it finds a shortcut has been entered, it pastes in the snippet over the shortcut.
The snippet for the If statement for example, has the short set as
If. So when I create an If block and go to the end of it to enter my comment, the snippet kicks in to take my code from this

to this:

Because I want to continue with my commenting standards, I had to change the shortcut for the If statement snippet. I opened the snippet file located at C:\Program Files\
Microsoft Visual Studio 8\Vb\Snippets\1033\language\IfStatement.snippet and changed the value of the Shortcut element. Problem solved.
Tags: