Partilhar via


ProvideLanguageServiceAttribute.CodeSenseDelay Property

Determines the amount of time before a parse operation is started to support an IntelliSense operation.

Namespace:  Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.11.0 (in Microsoft.VisualStudio.Shell.11.0.dll)

Syntax

'Declaração
Public Property CodeSenseDelay As Integer
public int CodeSenseDelay { get; set; }

Property Value

Type: System.Int32
Returns the number of milliseconds delay before a parse is started.

Remarks

To avoid excessive parsing while the user works, Many IntelliSense operations trigger a parse only if the system is idle for a period of time. This period of time is determined by the CodeSenseDelay property. For example, if the IntelliSense Quick Info is supported (the CodeSense and QuickInfo properties are set to true) and the CodeSenseDelay is set to 1500, when the user holds the cursor over an identifier, the language service waits 1500 milliseconds before starting a parse operation that returns information about that identifier. The information is then shown in a ToolTip window that appears next to the identifier.

If the CodeSenseDelay is too short, excessive parsing may slow the response time of the user interface. If the CodeSenseDelay is too long, the user may not wait long enough for the feature to be activated and may think the feature is not supported.

This property is specific to the managed package framework (MPF).

The default value is 1000 milliseconds when the corresponding registry entry is accessed through the LanguagePreferences class.

The registry entry looks like this:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\[X.Y]\Languages\Language Services\
  [Language Name]\
    CodeSenseDelay = reg_dword: 0x000005dc

Examples

    [ProvideLanguageService(typeof(MyLanguageService),           // Required
                            MyConstants.languageName,            // Required
                            MyConstants.languageNameResourceID,  // Required
        // Optional language service properties
        CodeDelay = 1500,  // Milliseconds to wait before parsing
                           )]

.NET Framework Security

See Also

Reference

ProvideLanguageServiceAttribute Class

Microsoft.VisualStudio.Shell Namespace