Partager via


ProvideLanguageServiceAttribute.EnableAsyncCompletion Property

Determines whether the language supports background parsing.

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

Syntax

'Declaration
Public Property EnableAsyncCompletion As Boolean
public bool EnableAsyncCompletion { get; set; }
public:
property bool EnableAsyncCompletion {
    bool get ();
    void set (bool value);
}
member EnableAsyncCompletion : bool with get, set
function get EnableAsyncCompletion () : boolean 
function set EnableAsyncCompletion (value : boolean)

Property Value

Type: Boolean
Returns true if background parsing is allowed; otherwise, returns false.

Remarks

Whenever a completion list needs to be displayed, a parsing operation is started to determine what goes in the completion list. To maintain the responsiveness of the user interface, the parsing operation should be performed on a background thread. If a language service supports background parsing, set the EnableAsyncCompletion property to true.

Note

The managed package framework (MPF) examines this property anytime it starts a potentially lengthy parse and not just for completion lists.

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

The default is true 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]\
    EnableAsyncCompletion = reg_dword: 0x00000001

Examples

    [ProvideLanguageService(typeof(MyLanguageService),           // Required
                            MyConstants.languageName,            // Required
                            MyConstants.languageNameResourceID,  // Required
        // Optional language service properties
        EnableAsyncCompletion = true,  // Background parsing supported
                           )]

.NET Framework Security

See Also

Reference

ProvideLanguageServiceAttribute Class

Microsoft.VisualStudio.Shell Namespace