diff options
author | Arcanox <arcanox@arcanox.me> | 2021-09-25 18:01:40 -0500 |
---|---|---|
committer | Arcanox <arcanox@arcanox.me> | 2021-09-25 18:01:40 -0500 |
commit | 26b94c16676c6e813ffc75aef4efccb4a25145d1 (patch) | |
tree | d51cab618052fe7470aae1910b00230960274831 | |
parent | 052ceb3a61222eb525839d075fcf33cf9e7189c3 (diff) | |
download | lua-language-server-26b94c16676c6e813ffc75aef4efccb4a25145d1.zip |
Fix semantic token highlighting not working after the "newparser" changes recently merged into master
-rw-r--r-- | script/provider/provider.lua | 16 |
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 |