Skip to content

Commit 225fd6a

Browse files
committed
fix #1215 penetrate parentheses
1 parent 6fd670b commit 225fd6a

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# changelog
22

3+
## 3.3.1
4+
* `FIX` [#1215](https://github.com/sumneko/lua-language-server/issues/1215)
5+
36
## 3.3.0
47
`2022-6-15`
58
* `NEW` `LuaDoc` supports `` `CODE` ``

script/vm/runner.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ function mt:_lookInto(action, topNode, outNode)
294294
self:_lookInto(arg, topNode)
295295
end
296296
end
297+
elseif action.type == 'paren' then
298+
topNode, outNode = self:_lookInto(action.exp, topNode, outNode)
297299
else
298300
guide.eachSourceContain(action, top.finish, function(source)
299301
self:_lookInto(source, topNode)

test/type_inference/init.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2627,3 +2627,13 @@ if tp == 'integer' then
26272627
print(<?x?>)
26282628
end
26292629
]]
2630+
2631+
TEST 'integer' [[
2632+
---@type integer?
2633+
local x
2634+
2635+
if (x == nil) then
2636+
else
2637+
print(<?x?>)
2638+
end
2639+
]]

0 commit comments

Comments
 (0)