From b8feb6626cd4caefba683eaf4f99ca0600aab950 Mon Sep 17 00:00:00 2001 From: Arcanox Date: Sun, 26 Sep 2021 14:49:55 -0500 Subject: Put back thing that I didn't mean to commit --- script/provider/provider.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'script/provider/provider.lua') 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 _ = 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 -- cgit v1.2.3