summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArcanox <arcanox@arcanox.me>2021-09-25 18:01:40 -0500
committerArcanox <arcanox@arcanox.me>2021-09-25 18:01:40 -0500
commit26b94c16676c6e813ffc75aef4efccb4a25145d1 (patch)
treed51cab618052fe7470aae1910b00230960274831
parent052ceb3a61222eb525839d075fcf33cf9e7189c3 (diff)
downloadlua-language-server-26b94c16676c6e813ffc75aef4efccb4a25145d1.zip
Fix semantic token highlighting not working after the "newparser" changes recently merged into master
-rw-r--r--script/provider/provider.lua16
1 files changed, 2 insertions, 14 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index 070652ef..9803801b 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -688,11 +688,7 @@ proto.on('textDocument/semanticTokens/full', function (params)
workspace.awaitReady()
local _ <close> = progress.create(lang.script.WINDOW_PROCESSING_SEMANTIC_FULL, 0.5)
local core = require 'core.semantic-tokens'
- local text = files.getText(uri)
- if not text then
- return nil
- end
- local results = core(uri, 0, #text)
+ local results = core(uri, 0, math.huge)
return {
data = results
}
@@ -706,15 +702,7 @@ 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 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 start, finish = converter.unpackRange(uri, params.range)
local results = core(uri, start, finish)
return {
data = results