summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-11-27 17:32:15 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-11-27 17:32:15 +0800
commitaeeb7d9a52ca429bfd4db41a1e675261d285665c (patch)
treeb6a4b09db417eb9aa1b9405cd508af8d3c484aa2
parent4b4b29fae0fee6cf109be4400104d23b191d24fd (diff)
downloadlua-language-server-aeeb7d9a52ca429bfd4db41a1e675261d285665c.zip
修正报错
-rw-r--r--script-beta/core/hover/label.lua8
-rw-r--r--script-beta/vm/getValue.lua10
2 files changed, 14 insertions, 4 deletions
diff --git a/script-beta/core/hover/label.lua b/script-beta/core/hover/label.lua
index 72ce60f4..a424e453 100644
--- a/script-beta/core/hover/label.lua
+++ b/script-beta/core/hover/label.lua
@@ -53,12 +53,12 @@ local function isGlobalField(source)
or source.type == 'setmethod'
or source.type == 'getmethod'
or source.type == 'tablefield' then
- local node = source.node
- if node.type == 'setglobal'
- or node.type == 'getglobal' then
+ local parent = source.parent
+ if parent.type == 'setglobal'
+ or parent.type == 'getglobal' then
return true
end
- return isGlobalField(node)
+ return isGlobalField(parent)
else
return false
end
diff --git a/script-beta/vm/getValue.lua b/script-beta/vm/getValue.lua
index ee486a54..30fd00aa 100644
--- a/script-beta/vm/getValue.lua
+++ b/script-beta/vm/getValue.lua
@@ -1,4 +1,5 @@
local vm = require 'vm.vm'
+local util = require 'utility'
local typeSort = {
['boolean'] = 1,
@@ -563,6 +564,12 @@ local function checkLibraryReturn(source)
if not rtn then
return nil
end
+ if not rtn.type then
+ return nil
+ end
+ if rtn.type == '...' then
+ return
+ end
return alloc {
type = rtn.type,
value = rtn.value,
@@ -598,6 +605,9 @@ local function checkLibraryArg(source)
if not arg then
return
end
+ if not arg.type then
+ return
+ end
if arg.type == '...' then
return
end