Compartilhar via


ProvideLanguageServiceAttribute.RequestStockColors Property

Definition

Determines if the language service is using the built-in colorable items as supplied by Visual Studio.

public:
 property bool RequestStockColors { bool get(); void set(bool value); };
public:
 property bool RequestStockColors { bool get(); void set(bool value); };
public bool RequestStockColors { get; set; }
member this.RequestStockColors : bool with get, set
Public Property RequestStockColors As Boolean

Property Value

Returns true if the language service uses the built-in colorable items; otherwise, returns false, indicating the language service is supplying custom colorable items.

Examples

[ProvideLanguageService(typeof(MyLanguageService),           // Required  
                        MyConstants.languageName,            // Required  
                        MyConstants.languageNameResourceID,  // Required  
    // Optional language service properties  
    RequestStockColors = true,  // use built-in colors only  
                       )]  

Remarks

Syntax highlighting (also known as syntax coloring) can greatly enhance the readability of source code. A language service provides values that specify which colorable item to use for each language element and the editor renders the source in the appropriate colors. The language service can use the built-in colorable items supplied by Visual Studio, in which case, the language service should set the RequestStockColors property to true. Otherwise, the language service must supply its own list of colorable items that describes the colors to use for each language element. This is done through the IVsProvideColorableItems interface. The managed package framework (MPF) LanguageService class already supports the IVsProvideColorableItems interface but the corresponding methods must be implemented to do anything useful.

This property is available for any language service implementation.

The default is false, indicating the language service supplies custom colorable items.

The registry entry looks like this:

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

Applies to