Microsoft KB Archive/913452

= A TAB character may be inserted instead of the code snippet when you use a code snippet shortcut in Visual Studio 2005 =

Article ID: 913452

Article Last Modified on 12/11/2006

-

APPLIES TO


 * Microsoft Visual Studio 2005 Standard Edition
 * Microsoft Visual Studio 2005 Professional Edition
 * Microsoft Visual Studio 2005 Express Edition
 * Microsoft Visual Studio 2005 Team System Architect Edition
 * Microsoft Visual Studio 2005 Team System Developer Edition
 * Microsoft Visual Studio 2005 Team System Test Edition
 * Microsoft Visual Basic 2005
 * Microsoft Visual C# 2005 Express Edition
 * Microsoft Visual J# 2005 Express Edition

-





SYMPTOMS
When you use a code snippet shortcut to insert a code snippet in Microsoft Visual Studio 2005, a TAB character may be inserted instead of the code snippet. You may experience this problem if the code snippet shortcut contains certain non-alphanumeric characters.



CAUSE
This problem occurs because the code snippet shortcut contains characters that are classified as non-spacing marks. Non-spacing marks are not numbers or letters. Therefore, you cannot use non-spacing marks in code snippet shortcuts.



WORKAROUND
To work around this problem, use one of the following methods:
 * Change the code snippet shortcut so that it contains only alphanumeric characters.
 * Use the Microsoft IntelliSense code snippet picker to insert a code snippet. To do this, follow these steps:
 * Right-click the Code Editor where you want to insert the code snippet, and then click Insert Snippet. The IntelliSense code snippet picker appears.
 * In the code snippet picker, locate the code snippet that you want to insert.
 * Double-click the code snippet.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



MORE INFORMATION
Many complex script languages contain Unicode characters that are classified as non-spacing marks. These languages include Arabic, Hebrew, all Indic languages, all Southeast Asian languages, and some European languages. Non-spacing marks are not permitted in code snippet shortcuts.

The following code determines whether each character in a string is a non-spacing mark. To analyze your code, create a console application. Then, paste the following code in the main method.

Visual Basic Dim Str As String Str = &quot;&quot;

For Each c As Char In Str Console.WriteLine(c & &quot; : &quot; & Char.IsLetterOrDigit(c)) Next Visual C# string Str = &quot;&quot;;

foreach (char c in Str) {               Console.WriteLine(c + &quot; : &quot; + char.IsLetterOrDigit(c)); } Note  is a placeholder for the string that you want to analyze.

