共用方式為


ProvideLanguageServiceAttribute.MaxErrorMessages Property

Definition

Determines the maximum number of errors message that a language service can report for a parsing operation.

public:
 property int MaxErrorMessages { int get(); void set(int value); };
public:
 property int MaxErrorMessages { int get(); void set(int value); };
public int MaxErrorMessages { get; set; }
member this.MaxErrorMessages : int with get, set
Public Property MaxErrorMessages As Integer

Property Value

Returns a number indicating the maximum number of errors that can be reported.

Examples

[ProvideLanguageService(typeof(MyLanguageService),           // Required  
                        MyConstants.languageName,            // Required  
                        MyConstants.languageNameResourceID,  // Required  
    // Optional language service properties  
    MaxErrorMessages = 15,  // Max messages to report  
                       )]  

Remarks

A language service can report warnings and errors that may result from a parsing operation. These warnings and errors are displayed in the Error List task window. The MaxErrorMessages property specifies the maximum number of errors that can be displayed at a time in the Error List window by the language service. Keeping this value fairly small reduces the amount of clutter that can appear, especially if parsing occurs while the user is typing and they have not finished typing a particular language construct.

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

The default is 10 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]\  
    MaxErrorMessages = reg_dword: 0x0000000f  

Applies to