次の方法で共有


How to: Use Built-In Colorable Items

Before you use the built-in colorable items, you must first signal to the integrated development environment (IDE) that you are not providing your own custom colorable items, which in this case would be IVsProvideColorableItems objects. You do this by setting a registry entry for the language service.

To use built-in colorable items

  1. Under HKEY_LOCAL_MACHINE\VisualStudio\X.Y\Languages\Language Services\Language Name, where X.Y is a version of Visual Studio and Language Name is the name of your language, create a DWORD registry entry value called RequestStockColors.

  2. Set the RequestStockColors registry entry value to 1.

    After you create the registry entry, your colorizer's ColorizeLine method can use the members of the DEFAULTITEMS enumeration to fill in the array of color attributes for use by the editor.

    注意

    Do not set this registry entry if you are providing custom colorable items. For more information, see Custom Colorable Items.

See Also

Concepts

Syntax Coloring in Custom Editors

Syntax Coloring

Implementing Syntax Coloring

Custom Colorable Items

Registering a Language Service