
Today I'd like to show a preview of the next huge feature area coming to SyntaxEditor for WPF and Silverlight: IntelliPrompt code snippets!
UPDATE: Code snippet features are now live for WPF and Silverlight with the release of version 2012.1!
Overview
Code snippets are predefined templates of code that can be inserted into the document to help the end user develop code more efficiently. They can contain multiple fields and the end user can tab between the fields while the code snippet is active. Dependent fields can be set up such that when the first field's value is changed, all the dependent fields update their values as well.
Activating Code Snippets
Via Shortcuts
Code snippets can be activated by typing their shortcut and pressing Tab immediately after.
.NET Languages Add-on Integration
The .NET Languages Add-on has been enhanced to automatically show available code snippets in the completion list displayed by Ctrl+Space. This feature works in both C# and Visual Basic.

Press Tab to insert the code snippet's shortcut text. Then Tab again to activate it per above.
Insert Snippet Popup
An Insert Snippet popup (another way to insert code snippets) probably won't make the first 2012.1 release, but it is planned for future implementation.
Editing a Template
Once a code snippet has been activated, it's template code is inserted into the editor and the included fields are highlighted:

In this screen, we inserted a code snippet for a C# for statement. Note how there are two fields: index and count. The index field shows up three times in the template. The second and third times have dotted borders, meaning they are dependent on the first field.

In this screen, we have changed the index field to have a value of i.

Next, the Tab key is pressed to move focus to the next field in the template, which is count. When the caret leaves a field that has been edited, the related dependent fields' values update. In this sample, all the index fields now have the value i.

In this final screen, we pressed Enter to exit template editing mode. The caret automatically moves to an offset designated by the code snippet. In this case, it was told to move within the for block, and indented a tab stop.
ToolTips
When hovering the mouse over a code snippet template field in the editor, if a tooltip description for the field was specified in the code snippet, it will be displayed.
Object Model
Our code snippet object model loads and saves to the exact same code snippet file format found in Visual Studio. This makes it easy to import and reuse the hundreds of code snippets distributed with Visual Studio and found out on the web.
Code snippet folder and file hierarchies can be loaded from the file system with one easy call, or can be built completely programmatically.
Events
A new event sink is included that allows languages to listen to multiple code snippet-related events, such as when a new code snippet template is activating, or a new field is activated, etc.
Summary
IntelliPrompt code snippets are a very handy feature for end users. And with our 100% compatibility with Visual Studio code snippets, it's very easy to add pre-built code snippets to your own apps.
For those of you with custom language implementations (not C#/VB), code snippets can be used with your language as well.
We're excited to get this into your hands soon. It will be included in the upcoming 2012.1 versions of our WPF and Silverlight controls.
UPDATE: Code snippet features are now live for WPF and Silverlight with the release of version 2012.1!
