From 73130023824293b09986aba141ad6c64d2e50158 Mon Sep 17 00:00:00 2001 From: Stachu Korick Date: Wed, 3 Jul 2024 20:54:34 -0400 Subject: [PATCH] clarify deltaLine and deltaStart --- _specifications/lsp/3.17/language/semanticTokens.md | 4 ++-- _specifications/lsp/3.18/language/semanticTokens.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_specifications/lsp/3.17/language/semanticTokens.md b/_specifications/lsp/3.17/language/semanticTokens.md index ddb7fddf1..760095985 100644 --- a/_specifications/lsp/3.17/language/semanticTokens.md +++ b/_specifications/lsp/3.17/language/semanticTokens.md @@ -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` diff --git a/_specifications/lsp/3.18/language/semanticTokens.md b/_specifications/lsp/3.18/language/semanticTokens.md index 93ca4a4a6..17009c1fc 100644 --- a/_specifications/lsp/3.18/language/semanticTokens.md +++ b/_specifications/lsp/3.18/language/semanticTokens.md @@ -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`.