Skip to content

Commit

Permalink
fix #1887
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Feb 10, 2023
1 parent 4943e05 commit 3154cef
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
6 changes: 4 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
## 3.6.11
* `CHG` completion: don't show loading process
* `FIX` [#1886]
* `FIX` [#1895]
* `FIX` [#1887]
* `FIX` [#1889]
* `FIX` [#1895]

[#1886]: https://github.com/LuaLS/lua-language-server/issues/1886
[#1895]: https://github.com/LuaLS/lua-language-server/issues/1895
[#1887]: https://github.com/LuaLS/lua-language-server/issues/1887
[#1889]: https://github.com/LuaLS/lua-language-server/issues/1889
[#1895]: https://github.com/LuaLS/lua-language-server/issues/1895

## 3.6.10
`2023-2-7`
Expand Down
4 changes: 4 additions & 0 deletions script/vm/tracer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ local lookIntoChild = util.switch()
---@param topNode vm.node
---@param outNode? vm.node
: call(function (tracer, action, topNode, outNode)
if action.type == 'loop' then
tracer:lookIntoChild(action.init, topNode)
tracer:lookIntoChild(action.max, topNode)
end
if action[1] then
tracer:lookIntoBlock(action, action.bstart, topNode:copy())
local lastAssign = tracer:getLastAssign(action.start, action.finish)
Expand Down
14 changes: 14 additions & 0 deletions test/type_inference/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4219,3 +4219,17 @@ end
function Y()
end
]]

TEST 'A_Class' [[
---@class A_Class
local A = { x = 5 }
function A:func()
for i = 1, <?self?>.x do
print(i)
end
self.y = 3
self.y = self.y + 3
end
]]

0 comments on commit 3154cef

Please sign in to comment.