summaryrefslogtreecommitdiff
path: root/script-beta/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-10-09 16:47:36 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-10-09 16:47:36 +0800
commitb5311472564006622cc3a2c79dc105a488ca5360 (patch)
treee3860627e6e0fd28d279568bd4be7361c8430928 /script-beta/core
parentc0e93478ef0e11aa8aa556af15815e6415cabc3f (diff)
downloadlua-language-server-b5311472564006622cc3a2c79dc105a488ca5360.zip
提升语义着色的性能
Diffstat (limited to 'script-beta/core')
-rw-r--r--script-beta/core/semantic-tokens.lua5
1 files changed, 1 insertions, 4 deletions
diff --git a/script-beta/core/semantic-tokens.lua b/script-beta/core/semantic-tokens.lua
index 8947bd88..2927a295 100644
--- a/script-beta/core/semantic-tokens.lua
+++ b/script-beta/core/semantic-tokens.lua
@@ -126,14 +126,11 @@ return function (uri, start, finish)
local results = {}
local count = 0
- guide.eachSource(ast.ast, function (source)
+ guide.eachSourceBetween(ast.ast, start, finish, function (source)
local method = Care[source.type]
if not method then
return
end
- if source.start > finish or source.finish < start then
- return
- end
method(source, results)
count = count + 1
if count % 100 == 0 then