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



The information in this article 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:
    1. Right-click the Code Editor where you want to insert the code snippet, and then click Insert Snippet. The IntelliSense code snippet picker appears.
    2. In the code snippet picker, locate the code snippet that you want to insert.
    3. Double-click the code snippet.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" 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 = "<InputString>"

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

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

REFERENCES

For more information about the latest Unicode Standard, visit the following Web site:

Modification Type:MinorLast Reviewed:10/3/2006
Keywords:kbExpertiseAdvanced kbvs2005mos kbvs2005std kbvs2005pro kbvs2005exp kbUnicode kbprb KB913452 kbAudDeveloper kbAudITPRO