Skip to content

Commit

Permalink
fix #1368
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Jul 22, 2022
1 parent 5beb3eb commit 6570692
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* `CHG` improve supports for multi-workspace
* `FIX` [#1354](https://github.com/sumneko/lua-language-server/issues/1354)
* `FIX` [#1355](https://github.com/sumneko/lua-language-server/issues/1355)
* `FIX` [#1368](https://github.com/sumneko/lua-language-server/issues/1368)

## 3.5.0
`2022-7-19`
Expand Down
13 changes: 8 additions & 5 deletions script/vm/generic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ local mt = {}
mt.__index = mt
mt.type = 'generic'

---@param source vm.object
---@param source vm.object?
---@param resolved? table<string, vm.node>
---@return vm.object
---@return vm.object?
local function cloneObject(source, resolved)
if not resolved then
if not resolved or not source then
return source
end
if source.type == 'doc.generic.name' then
Expand Down Expand Up @@ -126,8 +126,11 @@ function mt:resolve(uri, args)
result:merge(nd)
else
---@cast nd -vm.global
local clonedNode = vm.compileNode(cloneObject(nd, resolved))
result:merge(clonedNode)
local clonedObject = cloneObject(nd, resolved)
if clonedObject then
local clonedNode = vm.compileNode(clonedObject)
result:merge(clonedNode)
end
end
end
return result
Expand Down
1 change: 1 addition & 0 deletions script/vm/runner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ function mt:_lookIntoChild(action, topNode, outNode)
end
elseif action.type == 'local' then
if action.value
and action.ref
and action.value.type == 'select' then
local index = action.value.sindex
local call = action.value.vararg
Expand Down

0 comments on commit 6570692

Please sign in to comment.