public final class SyntaxToken

  1. Object
  2. SyntaxToken
One highlighted source span. Third-party highlighters may use a standard semantic kind or provide explicit colors without depending on the built-in tokenizer implementation.

Fields

public static final int KEYWORD = 1Standard semantic kind for a language keyword.
public static final int STRING = 2Standard semantic kind for a string or character literal.
public static final int COMMENT = 3Standard semantic kind for a comment.
public static final int NUMBER = 4Standard semantic kind for a numeric literal.
public static final int TYPE = 5Standard semantic kind for a tag or declared type.
public static final int PROPERTY = 6Standard semantic kind for a property or attribute name.
public final int startZero-based start column.
public final int lengthLength of the highlighted range.
public final int kindSemantic kind, usually one of the constants in this class.
public final int lightColorExplicit light-theme RGB color, or -1 to use the palette color for kind.
public final int darkColorExplicit dark-theme RGB color, or -1 to use the palette color for kind.

Constructors

public SyntaxToken(int start, int length, int kind)Creates a token that uses the editor palette for its semantic kind.
public SyntaxToken(int start, int length, int kind, int lightColor, int darkColor)Creates a token with explicit light and dark theme colors.

Inherited methods

Field details

KEYWORD

public static final int KEYWORD = 1
Standard semantic kind for a language keyword.

STRING

public static final int STRING = 2
Standard semantic kind for a string or character literal.

COMMENT

public static final int COMMENT = 3
Standard semantic kind for a comment.

NUMBER

public static final int NUMBER = 4
Standard semantic kind for a numeric literal.

TYPE

public static final int TYPE = 5
Standard semantic kind for a tag or declared type.

PROPERTY

public static final int PROPERTY = 6
Standard semantic kind for a property or attribute name.

start

public final int start
Zero-based start column.

length

public final int length
Length of the highlighted range.

kind

public final int kind
Semantic kind, usually one of the constants in this class.

lightColor

public final int lightColor
Explicit light-theme RGB color, or -1 to use the palette color for kind.

darkColor

public final int darkColor
Explicit dark-theme RGB color, or -1 to use the palette color for kind.

Constructor details

SyntaxToken

public SyntaxToken(int start, int length, int kind)
Creates a token that uses the editor palette for its semantic kind.

SyntaxToken

public SyntaxToken(int start, int length, int kind, int lightColor, int darkColor)
Creates a token with explicit light and dark theme colors.