summaryrefslogtreecommitdiff
path: root/script-beta/vm/getGlobals.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-07-25 15:47:53 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-07-25 15:47:53 +0800
commit10f43c44172fc9adc4f6f73a46da250c8c436279 (patch)
treec1d82a2d02bf307629aa2a845099a08c21d609f0 /script-beta/vm/getGlobals.lua
parentcc6236c6803103212b17dadb3014739509a14d31 (diff)
downloadlua-language-server-10f43c44172fc9adc4f6f73a46da250c8c436279.zip
修正bug
Diffstat (limited to 'script-beta/vm/getGlobals.lua')
-rw-r--r--script-beta/vm/getGlobals.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/script-beta/vm/getGlobals.lua b/script-beta/vm/getGlobals.lua
index adc6c9fc..53fff173 100644
--- a/script-beta/vm/getGlobals.lua
+++ b/script-beta/vm/getGlobals.lua
@@ -12,10 +12,12 @@ local function getGlobalsOfFile(uri)
local results = guide.requestFields(env)
for _, res in ipairs(results) do
local name = guide.getSimpleName(res)
- if not globals[name] then
- globals[name] = {}
+ if name then
+ if not globals[name] then
+ globals[name] = {}
+ end
+ globals[name][#globals[name]+1] = res
end
- globals[name][#globals[name]+1] = res
end
return globals
end