TokenColor Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides initial values for color indices as reported by an IScanner scanner.
public enum class TokenColor
public enum class TokenColor
enum TokenColor
public enum TokenColor
type TokenColor =
Public Enum TokenColor
- Inheritance
-
TokenColor
Fields
Name | Value | Description |
---|---|---|
Text | 0 | = 0. The default. This represents the color corresponding to the user's default text colors (the language service's ColorableItem list is ignored in this one case). |
Keyword | 1 | = 1. Represents the color for a language keyword (for example, "for", "if", or "else"). |
Comment | 2 | = 2. Represents the color for a comment. |
Identifier | 3 | = 3. Represents the color for an identifier or name (for example, a class, method, or variable name). |
String | 4 | = 4. Represents the color for a string, typically bounded by single or double quotes. |
Number | 5 | = 5. Represents the color for a number (a string of decimal or hexadecimal digits). |
Remarks
To support syntax highlighting, the language service scanner must identify each language element as a token and provide a color value for that token. This value is actually an index into a ColorableItem list. The language service can supply a custom list of ColorableItem objects or the language service can rely on a default list of ColorableItem objects supplied by Visual Studio. The index into either list has the type TokenColor.
If you are supplying custom ColorableItem objects from your language service, it is recommended that you adhere to the meaning of the labels for the first six token types in your language. However, you can readily expand on the choices here, adding additional elements as needed. Note that the first colorable item is always ignored as Visual Studio supplies its own values for plain text.