Class SemanticTokensData
java.lang.Object
org.eclipse.lemminx.services.extensions.semantictokens.SemanticTokensData
Builder for LSP semantic tokens encoded data.
Tokens are collected by offset and sorted before encoding. This allows multiple participants to add tokens in any order.
Each token is encoded as 5 integers: deltaLine, deltaStartChar, length, tokenType, tokenModifiers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToken(int offset, int length, int tokenType, int tokenModifiers) Add a semantic token at the given offset with the given length, token type index, and token modifiers bitmask.org.eclipse.lsp4j.SemanticTokensbuild()Build theSemanticTokensresult.booleanisEmpty()Returns true if no tokens have been added.
-
Constructor Details
-
SemanticTokensData
-
-
Method Details
-
addToken
public void addToken(int offset, int length, int tokenType, int tokenModifiers) Add a semantic token at the given offset with the given length, token type index, and token modifiers bitmask.- Parameters:
offset- the offset in the document.length- the length of the token.tokenType- the token type index (from the legend).tokenModifiers- the token modifiers bitmask.
-
build
public org.eclipse.lsp4j.SemanticTokens build()Build theSemanticTokensresult.- Returns:
- the semantic tokens result.
-
isEmpty
public boolean isEmpty()Returns true if no tokens have been added.- Returns:
- true if no tokens have been added.
-