summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-10 15:33:08 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-10 15:33:08 +0800
commit9d178abb78630e1184a4d2549ed695b9ddbbf855 (patch)
tree87b72db9eb96e8585cd71ed0169b56383f7cf588 /server
parent8e6091ef4cfe560d085401540ddd1cb33183ef29 (diff)
downloadlua-language-server-9d178abb78630e1184a4d2549ed695b9ddbbf855.zip
整理代码
Diffstat (limited to 'server')
-rw-r--r--server/libs/lua53/basic.lni1
-rw-r--r--server/libs/lua53/modules.lni1
-rw-r--r--server/src/matcher/type_inference.lua8
3 files changed, 7 insertions, 3 deletions
diff --git a/server/libs/lua53/basic.lni b/server/libs/lua53/basic.lni
index a6412ae9..74383619 100644
--- a/server/libs/lua53/basic.lni
+++ b/server/libs/lua53/basic.lni
@@ -210,6 +210,7 @@ default = 0
[select]
[setmetatable]
+special = 'setmetatable'
[tonumber]
diff --git a/server/libs/lua53/modules.lni b/server/libs/lua53/modules.lni
index ea3f2100..ba46ec00 100644
--- a/server/libs/lua53/modules.lni
+++ b/server/libs/lua53/modules.lni
@@ -2,6 +2,7 @@
type = 'function'
[require]
+special = 'require'
[package]
type = 'table'
diff --git a/server/src/matcher/type_inference.lua b/server/src/matcher/type_inference.lua
index 577e277d..f3ab8a33 100644
--- a/server/src/matcher/type_inference.lua
+++ b/server/src/matcher/type_inference.lua
@@ -157,9 +157,11 @@ function mt:searchVars(vars)
end
function mt:searchCall(call)
- if call.func and not self:getType(call.func) then
- self:setType(call.func, 'function')
- self:searchVar(call.func)
+ if call.func then
+ if not self:getType(call.func) then
+ self:setType(call.func, 'function')
+ self:searchVar(call.func)
+ end
end
end