diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-05 20:55:25 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-05 20:55:25 +0800 |
commit | 6f927f4fa9a7c6e0446755a3f6aa86570c684754 (patch) | |
tree | ff86afad2f404c8df68233767fcbbe3d626acabd /script-beta/core/workspace-symbol.lua | |
parent | fe6f1115b5302ddd8ea7ed3e61a222d7294454d0 (diff) | |
download | lua-language-server-6f927f4fa9a7c6e0446755a3f6aa86570c684754.zip |
优化有大量全局变量时的性能
Diffstat (limited to 'script-beta/core/workspace-symbol.lua')
-rw-r--r-- | script-beta/core/workspace-symbol.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/script-beta/core/workspace-symbol.lua b/script-beta/core/workspace-symbol.lua index fb3dd88f..4fc6a854 100644 --- a/script-beta/core/workspace-symbol.lua +++ b/script-beta/core/workspace-symbol.lua @@ -2,6 +2,7 @@ local files = require 'files' local guide = require 'parser.guide' local matchKey = require 'core.matchkey' local define = require 'proto.define' +local await = require 'await' local function buildSource(uri, source, key, results) if source.type == 'local' @@ -58,6 +59,10 @@ return function (key) for uri in files.eachFile() do searchFile(files.getOriginUri(uri), key, results) + if #results > 1000 then + break + end + await.delay() end return results |