diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-02-10 18:50:43 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-02-10 18:50:43 +0800 |
commit | a31a20040006460e2e0c0ad3df061e31f49a7f50 (patch) | |
tree | 9037d40cd535503591915bb9b3dd2b9ee6f14faf /script/vm | |
parent | 22d57238e59b796804cf27d59e2473266a1d265d (diff) | |
download | lua-language-server-a31a20040006460e2e0c0ad3df061e31f49a7f50.zip |
update
Diffstat (limited to 'script/vm')
-rw-r--r-- | script/vm/getDef.lua | 14 | ||||
-rw-r--r-- | script/vm/node/global.lua | 2 | ||||
-rw-r--r-- | script/vm/state.lua | 2 |
3 files changed, 16 insertions, 2 deletions
diff --git a/script/vm/getDef.lua b/script/vm/getDef.lua index d3c6c456..a28d093e 100644 --- a/script/vm/getDef.lua +++ b/script/vm/getDef.lua @@ -8,11 +8,25 @@ local simpleMap = util.switch() : case 'local' : call(function (source, results) results[#results+1] = source + if source.ref then + for _, ref in ipairs(source.ref) do + if ref.type == 'setlocal' then + results[#results+1] = ref + end + end + end end) : case 'getlocal' : case 'setlocal' : call(function (source, results) results[#results+1] = source.node + if source.node.ref then + for _, ref in ipairs(source.node.ref) do + if ref.type == 'setlocal' then + results[#results+1] = ref + end + end + end end) : getMap() diff --git a/script/vm/node/global.lua b/script/vm/node/global.lua index ebb06731..0e293ca3 100644 --- a/script/vm/node/global.lua +++ b/script/vm/node/global.lua @@ -46,7 +46,7 @@ end function mt:dropUri(uri) self.links[uri] = nil self.setsCache = nil - self.setsCache = nil + self.getsCache = nil end ---@return vm.node.global diff --git a/script/vm/state.lua b/script/vm/state.lua index 44b62684..87376952 100644 --- a/script/vm/state.lua +++ b/script/vm/state.lua @@ -38,7 +38,7 @@ end function m.dropUri(uri) local subscription = m.subscriptions[uri] m.subscriptions[uri] = nil - for name in pairs(subscription) do + for name in pairs(subscription.globals) do m.globals[name]:dropUri(uri) end end |