summaryrefslogtreecommitdiff
path: root/script/provider/provider.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/provider/provider.lua')
-rw-r--r--script/provider/provider.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index 05202c01..7a5ce558 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -702,7 +702,15 @@ proto.on('textDocument/semanticTokens/range', function (params)
workspace.awaitReady()
local _ <close> = progress.create(lang.script.WINDOW_PROCESSING_SEMANTIC_RANGE, 0.5)
local core = require 'core.semantic-tokens'
- local start, finish = converter.unpackRange(uri, params.range)
+ local cache = files.getOpenedCache(uri)
+ local start, finish
+ if cache and not cache['firstSemantic'] then
+ cache['firstSemantic'] = true
+ start = 0
+ finish = #files.getText(uri)
+ else
+ start, finish = converter.unpackRange(uri, params.range)
+ end
local results = core(uri, start, finish)
return {
data = results