public static class SemanticHighlightingTokens.Token extends java.lang.Object implements java.lang.Comparable<SemanticHighlightingTokens.Token>
Semantic highlighting tokens are not part of the protocol, as they're sent through the wire as an encoded string. The purpose of this data type is to help working with them.
Modifier and Type | Field and Description |
---|---|
int |
character
The zero-based character offset of the token in the line.
|
int |
length
The length of the token.
|
int |
scope
The internal index of the
TextMate
scope.
|
Constructor and Description |
---|
Token(int character,
int length,
int scope)
Creates a new highlighting token.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(SemanticHighlightingTokens.Token o) |
boolean |
equals(java.lang.Object obj) |
static java.util.List<SemanticHighlightingTokens.Token> |
fromIntArray(int... input)
|
int |
hashCode() |
static int[] |
toIntArray(java.lang.Iterable<? extends SemanticHighlightingTokens.Token> tokens)
Converts an iterable of tokens into an array of primitive integers.
|
public final int character
public final int length
public final int scope
public Token(int character, int length, int scope)
character
- the character offset of the token. Must not be a negative integer.length
- the length of the token. Must be an integer between 0
and
2
16-1
(inclusive).scope
- the scope. Must be an integer between 0
and
2
16-1
(inclusive).public static int[] toIntArray(java.lang.Iterable<? extends SemanticHighlightingTokens.Token> tokens)
public static java.util.List<SemanticHighlightingTokens.Token> fromIntArray(int... input)
toIntArray(java.lang.Iterable<? extends org.eclipse.lsp4j.util.SemanticHighlightingTokens.Token>)
. Converts an array of primitive
integers into a list of tokens. If the input is null
, returns with an
empty list. Throws an exception if the length of the arguments is not a
modulo of 3
.
The elements of the input will be used to create new SemanticHighlightingTokens.Token
instances,
hence they must comply the requirements described
here
.public int compareTo(SemanticHighlightingTokens.Token o)
compareTo
in interface java.lang.Comparable<SemanticHighlightingTokens.Token>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object