The new code snippet feature, IntelliSense code snippets, allows you to right-click within the Visual Basic code editor, and select from a hierarchical list of tasks you're most likely to want to accomplish. Selecting a task inserts the prewritten code into your source file for you. Figure 2 shows this feature in action.

Figure 2. Use IntelliSense code snippets within Visual Studio to simplify your coding process.
Once you've inserted the code snippet, you have the option to fix up items such as hard-coded paths and control references, as shown in Figure 3. With your adjustments, the inserted code can work correctly within your environment. The code snippet can include a reference to the appropriate online help topic, and provides tool tips reminding you of changes you need to make. The Insert Snippets option can determine whether you're inside a procedure or not, and can make the appropriate list of snippets available depending on the current context.

Figure 3. Replace values within the code snippet so that the code works correctly for you. Use the Tab key to navigate among the placeholders in the snippet.
Of course, you can create your own code snippets as well. These IntelliSense items are stored as XML files within a folder hierarchy (it's the folder hierarchy that determines the fly-out menus appearing within the code editor), and you have the option of saving your own code snippets, decorating the XML with your own tool tips and help references.
Edit and Continue
Quick development turnaround time has always been the hallmark of developing in Visual Basic, and programmers who miss the edit and continue feature in Visual Basic 6 can rejoice—it's back! In Visual Basic 2005, you can make changes to your code during debugging, back up the code instruction pointer if you want, and re-execute lines of code with the modified content. While in Break mode, you can modify code or fix bugs; almost any code modification will work. (Of course, some modifications force you to switch back to design mode and rebuild the project and there's no way around it.) This change for Visual Studio 2005 has huge numbers of Visual Basic developers cheering!
Debugger DataTips
While in Debug mode using Visual Studio .NET 2003, you could place the cursor over a simple variable, such as a string, to inspect its value. In Visual Studio 2005, this feature has been greatly enhanced; data tips now support complex types, as well. Figure 4 shows a simple example in which the data tip displays information about a complex type, and shows off the ability to drill into the hierarchy for the type. In addition to displaying values, you can also edit those values from within the data tips.

Figure 4. Data tips have been greatly enhanced for Visual Studio 2005. You can investigate complex data structures while debugging, without needing to load a separate window.
AutoCorrect
Visual Basic 2005 adds an AutoCorrect feature, making it simple to determine why invalid code won't compile, and to choose from multiple options in order to fix the errant code. If you make a simple typing error, as shown in Figure 5, clicking the Smart Task produces a list of suggestions from which you can select the correct code.

Figure 5. AutoCorrect can fix typing errors, supplying suggestions based on the text you've entered.
If you attempt to use a class, but neglect to import its namespace or provide the full class name, the AutoCorrect Smart Task offers suggestions, as shown in Figure 6.

Figure 6. If you neglect to import a namespace, you can count on AutoCorrect to supply the full name.
Imagine that you've created a read/write property and then decide to make it read-only. You add the ReadOnly keyword, but of course, now you see a blue "squiggle" indicating that something's wrong with the Set block (see Figure 7).

Figure 7. It's easy to see when code has an error. It's harder to figure out what to do about it. Visual Basic's AutoCorrect makes it easier.
Expanding the Smart Task displayed near the error displays a dialog box, as shown in Figure 8. On this dialog box, you can select either of the possible remedies, and then click the associated link to make the change.

Figure 8. Visual Basic Error Correction dialog box makes it easy to select and apply fixes.
Design-Time Expression Evaluation
Visual Studio 2005 adds back familiar functionality from Visual Basic 6—the ability to evaluate expressions at design time, in the Immediate window. It's useful to be able to call Framework methods and user-defined methods from within the Immediate window in order to test methods, debug code, and more. Figure 9 shows an example of evaluating expressions from within the Immediate window at design time.

Figure 9. Like Visual Basic 6, Visual Basic 2005 allows you to perform calculations in the Immediate window at design time.
You can also call code you've written. For example, Figure 10 shows an example calling code within a form's class. Of course, as you type into the Immediate window in Design mode, you get IntelliSense help just as you do in Break mode.

Figure 10. You can call code you've written yourself while in Design mode, even if the code is inside a form's class.
Exception Assistant
Visual Studio 2005 provides assistance when an unhandled run-time exception occurs. The exception handler bubble provides standard information about the exception, pointing to the exact location within the line of code if it can, and also gives helpful information indicating what to do about the exception, and how to prevent the exception from occurring again. Figure 11 shows the exception assistance bubble in action.
