summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-02-02 22:22:12 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-02-02 22:22:12 +0800
commit532d507aa04c2f220ae63d118898a39ab18d13c9 (patch)
tree1ee5fe73e3f50d9760d7440b5ec8b64abb596cff /script/vm
parentc33747ecdb348a77294e717a88a8b75d0a06ba33 (diff)
downloadlua-language-server-532d507aa04c2f220ae63d118898a39ab18d13c9.zip
fix errors
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/getGlobals.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/script/vm/getGlobals.lua b/script/vm/getGlobals.lua
index 842db4c3..0c502ecd 100644
--- a/script/vm/getGlobals.lua
+++ b/script/vm/getGlobals.lua
@@ -8,6 +8,9 @@ local config = require 'config'
local ws = require 'workspace'
local function getGlobalsOfFile(uri)
+ if not files.exists(uri) then
+ return {}
+ end
local cache = files.getCache(uri)
if cache.globals then
return cache.globals
@@ -47,6 +50,9 @@ local function getGlobalsOfFile(uri)
end
local function getGlobalSetsOfFile(uri)
+ if not files.exists(uri) then
+ return {}
+ end
local cache = files.getCache(uri)
if cache.globalSets then
return cache.globalSets