feat(lsp): semanticTokens/range #36705

Problem:
Nvim supports `textDocument/semanticTokens/full` and `…/full/delta`
already, but most servers don't support `…/full/delta` and Nvim will try
to request and process full semantic tokens response on every buffer
change. Even though the request is debounced, there is noticeable lag if
the token response is large (in a big file).

Solution:
Support `textDocument/semanticTokens/range`, which requests semantic
tokens for visible screen only.
This commit is contained in:
Tristan Knight
2025-12-01 02:06:56 +00:00
committed by GitHub
parent f9ef1a4cab
commit 23ddb2028b
4 changed files with 301 additions and 66 deletions

View File

@@ -616,6 +616,7 @@ local static_registration_capabilities = {
['textDocument/moniker'] = 'monikerProvider',
['textDocument/selectionRange'] = 'selectionRangeProvider',
['textDocument/semanticTokens/full'] = 'semanticTokensProvider',
['textDocument/semanticTokens/range'] = 'semanticTokensProvider',
['textDocument/typeDefinition'] = 'typeDefinitionProvider',
['textDocument/prepareTypeHierarchy'] = 'typeHierarchyProvider',
}