GH-221: Added the encode/decode utility for the highlighting tokens.#223
Merged
spoenemann merged 1 commit intoeclipse-lsp4j:masterfrom Aug 10, 2018
Merged
GH-221: Added the encode/decode utility for the highlighting tokens.#223spoenemann merged 1 commit intoeclipse-lsp4j:masterfrom
spoenemann merged 1 commit intoeclipse-lsp4j:masterfrom
Conversation
kittaakos
commented
Aug 9, 2018
| * <ul> | ||
| * <li>{@code array[3*i]} is the {@link Token#character character} of the token.</li> | ||
| * <li>{@code array[3*i+1]} is the {@link Token#length length} of the token.</li> | ||
| * <li>{@code array[3*i]} is the token {@link Token#scope scope}.</li> |
Contributor
Author
There was a problem hiding this comment.
Incorrect doc. Should be 3*i+2.
| * into a list of tokens. If the input is {@code null}, returns with an empty list. | ||
| * Throws an exception if the length of the arguments is not a modulo of {@code 3}. | ||
| */ | ||
| static def fromIntArray(int... input) { |
Contributor
Author
There was a problem hiding this comment.
I need to an assertion here. The ints cannot exceed the 0 and 232-1 (inclusive) range.
| * Returns with an empty string if the {@code tokens} argument is {@code null} or | ||
| * empty. | ||
| */ | ||
| static def String encode(Iterable<? extends Token> tokens) { |
Contributor
Author
There was a problem hiding this comment.
I have to add a encode/decode test with a huge chunk of data.
Contributor
Author
|
Ready for review. |
Contributor
|
We use Xtend only for protocol definitions. In other places please use Java. |
Contributor
Author
|
I have switched to Java. |
spoenemann
reviewed
Aug 10, 2018
| * Utility class for encoding and decoding semantic highlighting tokens into a | ||
| * compact, {@code base64} representation. | ||
| */ | ||
| public abstract class SemanticHighlightingTokens { |
Contributor
There was a problem hiding this comment.
Usually I make such a class final and declare a private default constructor instead of making it abstract. An abstract class looks like something that needs to be implemented in a subclass.
…ting tokens. Closes eclipse-lsp4j#221. Signed-off-by: Akos Kitta <[email protected]>
spoenemann
approved these changes
Aug 10, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #221.
Signed-off-by: Akos Kitta [email protected]