summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-08-09 18:05:48 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-08-09 18:05:48 +0800
commit46a258bf64bf15b757bcbd3b9d339f06627a69fe (patch)
treebee5a36fb2f9d5b3e39bf47672ef1f4066a44798 /script/core
parentacd37caafa2b4e9fa673327e54c5f010fa37641f (diff)
downloadlua-language-server-46a258bf64bf15b757bcbd3b9d339f06627a69fe.zip
`FIX` globals and class may lost
Diffstat (limited to 'script/core')
-rw-r--r--script/core/noder.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/script/core/noder.lua b/script/core/noder.lua
index 318020d0..a9aa153a 100644
--- a/script/core/noder.lua
+++ b/script/core/noder.lua
@@ -1405,6 +1405,10 @@ function m.compileAllNodes(source)
return noders
end
root._initedNoders = true
+ if not root._compiledGlobals then
+ collector.dropUri(guide.getUri(root))
+ end
+ root._compiledGlobals = true
log.debug('compileNodes:', guide.getUri(root))
guide.eachSource(root, function (src)
m.compileNode(noders, src)
@@ -1511,6 +1515,13 @@ end
---@param root parser.guide.object
---@return table
function m.compileGlobalNodes(root)
+ if root._initedNoders then
+ return
+ end
+ if not root._compiledGlobals then
+ collector.dropUri(guide.getUri(root))
+ end
+ root._compiledGlobals = true
local noders = m.getNoders(root)
local env = guide.getENV(root)
@@ -1530,7 +1541,6 @@ end
files.watch(function (ev, uri)
uri = files.asKey(uri)
if ev == 'update' then
- collector.dropUri(uri)
local state = files.getState(uri)
if state then
--m.compileAllNodes(state.ast)