Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _specifications/lsp/3.17/language/semanticTokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ so a `tokenModifier` value of `3` is first viewed as binary `0b00000011`, which

There are different ways how the position of a token can be expressed in a file. Absolute positions or relative positions. The protocol for the token format `relative` uses relative positions, because most tokens remain stable relative to each other when edits are made in a file. This simplifies the computation of a delta if a server supports it. So each token is represented using 5 integers. A specific token `i` in the file consists of the following array indices:

- at index `5*i` - `deltaLine`: token line number, relative to the previous token
- at index `5*i+1` - `deltaStart`: token start character, relative to the previous token (relative to 0 or the previous token's start if they are on the same line)
- at index `5*i` - `deltaLine`: token line number, relative to the start of the previous token
- at index `5*i+1` - `deltaStart`: token start character, relative to the start of the previous token (relative to 0 or the previous token's start if they are on the same line)
- at index `5*i+2` - `length`: the length of the token.
- at index `5*i+3` - `tokenType`: will be looked up in `SemanticTokensLegend.tokenTypes`. We currently ask that `tokenType` < 65536.
- at index `5*i+4` - `tokenModifiers`: each set bit will be looked up in `SemanticTokensLegend.tokenModifiers`
Expand Down
4 changes: 2 additions & 2 deletions _specifications/lsp/3.18/language/semanticTokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ so a `tokenModifier` value of `3` is first viewed as binary `0b00000011`, which

There are two different ways how the position of a token can be expressed in a file: Absolute positions or relative positions. The protocol for the token format `relative` uses relative positions, because most tokens remain stable relative to each other when edits are made in a file. This simplifies the computation of a delta if a server supports it. Each token is represented using 5 integers. A specific token `i` in the file consists of the following array indices:

- at index `5*i` - `deltaLine`: token line number, relative to the previous token.
- at index `5*i+1` - `deltaStart`: token start character, relative to the previous token (relative to 0 or the previous token's start if they are on the same line).
- at index `5*i` - `deltaLine`: token line number, relative to the start of the previous token.
- at index `5*i+1` - `deltaStart`: token start character, relative to the start of the previous token (relative to 0 or the previous token's start if they are on the same line).
- at index `5*i+2` - `length`: the length of the token.
- at index `5*i+3` - `tokenType`: will be looked up in `SemanticTokensLegend.tokenTypes`. We currently ask that `tokenType` < 65536.
- at index `5*i+4` - `tokenModifiers`: each set bit will be looked up in `SemanticTokensLegend.tokenModifiers`.
Expand Down