Skip to content

Commit 7aac174

Browse files
committed
trace filter of repeat
fix #2113
1 parent fc63802 commit 7aac174

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

.vscode/launch.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636
]
3737
],
3838
"windows": {
39-
"name": "🍄attach",
40-
"type": "lua",
41-
"request": "attach",
4239
"sourceMaps": [
4340
[
4441
"script\\*",

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## 3.6.20
44
* `NEW` support connecting by socket with `--socket=PORT`
5+
* `FIX` [#2113]
6+
7+
[#2113]: https://github.com/LuaLS/lua-language-server/issues/2113
58

69
## 3.6.19
710
`2023-4-26`

script/vm/tracer.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,9 @@ local lookIntoChild = util.switch()
296296
topNode = tracer.nodes[action]:copy()
297297
end
298298
end
299+
if action.type == 'repeat' then
300+
tracer:lookIntoChild(action.filter, topNode)
301+
end
299302
return topNode, outNode
300303
end)
301304
: case 'in'
@@ -745,6 +748,9 @@ function mt:lookIntoBlock(block, start, node)
745748
::CONTINUE::
746749
end
747750
self.nodes[block] = node
751+
if block.type == 'repeat' then
752+
self:lookIntoChild(block.filter, node)
753+
end
748754
if block.type == 'do'
749755
or block.type == 'loop'
750756
or block.type == 'in'

test/type_inference/init.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4292,3 +4292,9 @@ local m = setmetatable({},{ __index = { a = 1 } })
42924292
42934293
m.<?a?>
42944294
]]
4295+
4296+
TEST 'integer' [[
4297+
local x = 1
4298+
repeat
4299+
until <?x?>
4300+
]]

0 commit comments

Comments
 (0)