diff options
-rw-r--r-- | script/provider/provider.lua | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua index 3e8fec24..5ee99b3e 100644 --- a/script/provider/provider.lua +++ b/script/provider/provider.lua @@ -871,10 +871,30 @@ m.register 'workspace/symbol' { end } +local function toArray(map) + local array = {} + for k in pairs(map) do + array[#array+1] = k + end + table.sort(array, function (a, b) + return map[a] < map[b] + end) + return array +end + m.register 'textDocument/semanticTokens/full' { - abortByFileUpdate = true, + capability = { + semanticTokensProvider = { + legend = { + tokenTypes = toArray(define.TokenTypes), + tokenModifiers = toArray(define.TokenModifiers), + }, + full = true, + }, + }, ---@async function (params) + log.debug('textDocument/semanticTokens/full') local uri = files.getRealUri(params.textDocument.uri) workspace.awaitReady(uri) local _ <close> = progress.create(scope.getScope(uri), lang.script.WINDOW_PROCESSING_SEMANTIC_FULL, 0.5) @@ -886,18 +906,6 @@ m.register 'textDocument/semanticTokens/full' { end } -local function toArray(map) - local array = {} - for k in pairs(map) do - array[#array+1] = k - end - table.sort(array, function (a, b) - return map[a] < map[b] - end) - return array -end - - m.register 'textDocument/semanticTokens/range' { capability = { semanticTokensProvider = { @@ -906,7 +914,6 @@ m.register 'textDocument/semanticTokens/range' { tokenModifiers = toArray(define.TokenModifiers), }, range = true, - full = false, }, }, ---@async |