summaryrefslogtreecommitdiff
path: root/server-beta/src/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-11-10 22:52:40 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-11-10 22:52:40 +0800
commita36f8786bdf123fdaa894427e3ab2cdfa71da72a (patch)
tree816fa3c35a9af944a7e2070a3daecc3d60a9c7ce /server-beta/src/core
parent4cc750f1c150930558bb721b5a73948b33549e42 (diff)
downloadlua-language-server-a36f8786bdf123fdaa894427e3ab2cdfa71da72a.zip
在一些性能热点中断
Diffstat (limited to 'server-beta/src/core')
-rw-r--r--server-beta/src/core/diagnostics/redundant-parameter.lua6
-rw-r--r--server-beta/src/core/diagnostics/unused-function.lua8
2 files changed, 11 insertions, 3 deletions
diff --git a/server-beta/src/core/diagnostics/redundant-parameter.lua b/server-beta/src/core/diagnostics/redundant-parameter.lua
index 04012ef4..43bb93ed 100644
--- a/server-beta/src/core/diagnostics/redundant-parameter.lua
+++ b/server-beta/src/core/diagnostics/redundant-parameter.lua
@@ -3,7 +3,7 @@ local guide = require 'parser.guide'
local searcher = require 'searcher'
local lang = require 'language'
local define = require 'proto.define'
-local library = require 'library'
+local await = require 'await'
local function countLibraryArgs(source)
local func = searcher.getLibrary(source)
@@ -60,6 +60,10 @@ return function (uri, callback)
return
end
+ await.delay(function ()
+ return files.globalVersion
+ end)
+
local func = source.node
local funcArgs
searcher.eachRef(func, function (info)
diff --git a/server-beta/src/core/diagnostics/unused-function.lua b/server-beta/src/core/diagnostics/unused-function.lua
index 0dd55906..eb6b8f7f 100644
--- a/server-beta/src/core/diagnostics/unused-function.lua
+++ b/server-beta/src/core/diagnostics/unused-function.lua
@@ -1,8 +1,9 @@
local files = require 'files'
local guide = require 'parser.guide'
local searcher = require 'searcher'
-local define = require 'proto.define'
-local lang = require 'language'
+local define = require 'proto.define'
+local lang = require 'language'
+local await = require 'await'
return function (uri, callback)
local ast = files.getAst(uri)
@@ -27,5 +28,8 @@ return function (uri, callback)
message = lang.script.DIAG_UNUSED_FUNCTION,
}
end
+ await.delay(function ()
+ return files.globalVersion
+ end)
end)
end