diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-01-12 17:57:12 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2023-01-12 17:57:12 +0800 |
commit | 6c92b9a7cc10971e4ec6402fe9c23b1839c58c80 (patch) | |
tree | b4e593ebdececafb57a71962371fe9d9d89030c5 /script/vm/global.lua | |
parent | 5febd3a533762920ab4085fc8d3494fd64b3a6bb (diff) | |
download | lua-language-server-6c92b9a7cc10971e4ec6402fe9c23b1839c58c80.zip |
stash
Diffstat (limited to 'script/vm/global.lua')
-rw-r--r-- | script/vm/global.lua | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/script/vm/global.lua b/script/vm/global.lua index 5ffcdb34..0a90829a 100644 --- a/script/vm/global.lua +++ b/script/vm/global.lua @@ -540,31 +540,38 @@ function vm.getEnums(source) end ---@param source parser.object +---@return boolean function vm.compileByGlobal(source) local global = vm.getGlobalNode(source) if not global then - return + return false end - if global.cate == 'variable' then + if global.cate == 'type' then vm.setNode(source, global) - if guide.isAssign(source) then - if source.value then - vm.setNode(source, vm.compileNode(source.value)) - end - return + return false + end + vm.setNode(source, global) + if guide.isAssign(source) then + if vm.bindDocs(source) then + return true end - local node = vm.traceNode(source) - if node then - vm.setNode(source, node, true) + if source.value then + vm.setNode(source, vm.compileNode(source.value)) end - return + return true end - local globalBase = vm.getGlobalBase(source) - if not globalBase then - return + local node = vm.traceNode(source) + if node then + vm.setNode(source, node, true) + else + local globalBase = vm.getGlobalBase(source) + if not globalBase then + return false + end + local globalNode = vm.compileNode(globalBase) + vm.setNode(source, globalNode, true) end - local globalNode = vm.compileNode(globalBase) - vm.setNode(source, globalNode, true) + return true end ---@param source parser.object |