summaryrefslogtreecommitdiff
path: root/script/vm/node.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-16 23:32:59 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-16 23:32:59 +0800
commit944b7d59f9dbb8f7f41083478018f3e3ae255713 (patch)
tree6245a2234956278610e42ae923660ff84bd7507c /script/vm/node.lua
parentd31ecd5f2b8793667b3e8dad576737440c47a29d (diff)
downloadlua-language-server-944b7d59f9dbb8f7f41083478018f3e3ae255713.zip
cleanup
Diffstat (limited to 'script/vm/node.lua')
-rw-r--r--script/vm/node.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/script/vm/node.lua b/script/vm/node.lua
index 21f95a49..6906da7e 100644
--- a/script/vm/node.lua
+++ b/script/vm/node.lua
@@ -2,6 +2,7 @@ local files = require 'files'
local localMgr = require 'vm.local-manager'
---@class vm
local vm = require 'vm.vm'
+local ws = require 'workspace.workspace'
---@type table<vm.object, vm.node>
vm.nodeCache = {}
@@ -271,6 +272,8 @@ end
files.watch(function (ev, uri)
if ev == 'version' then
- vm.clearNodeCache()
+ if ws.isReady(uri) then
+ vm.clearNodeCache()
+ end
end
end)