diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-16 14:50:35 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-16 14:50:35 +0800 |
commit | 225fd6a94b989dc489d7e884ddd5845cd208aeea (patch) | |
tree | f57b48397cdf85ada40a079380b2fa4fa1bf8dbc | |
parent | 6fd670b15c9403e92ab9a803f8fa885fe3d9bee2 (diff) | |
download | lua-language-server-225fd6a94b989dc489d7e884ddd5845cd208aeea.zip |
fix #1215 penetrate parentheses
-rw-r--r-- | changelog.md | 3 | ||||
-rw-r--r-- | script/vm/runner.lua | 2 | ||||
-rw-r--r-- | test/type_inference/init.lua | 10 |
3 files changed, 15 insertions, 0 deletions
diff --git a/changelog.md b/changelog.md index 7f381afd..5d5de00a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # changelog +## 3.3.1 +* `FIX` [#1215](https://github.com/sumneko/lua-language-server/issues/1215) + ## 3.3.0 `2022-6-15` * `NEW` `LuaDoc` supports `` `CODE` `` diff --git a/script/vm/runner.lua b/script/vm/runner.lua index 43cbd155..793b4417 100644 --- a/script/vm/runner.lua +++ b/script/vm/runner.lua @@ -294,6 +294,8 @@ function mt:_lookInto(action, topNode, outNode) self:_lookInto(arg, topNode) end end + elseif action.type == 'paren' then + topNode, outNode = self:_lookInto(action.exp, topNode, outNode) else guide.eachSourceContain(action, top.finish, function(source) self:_lookInto(source, topNode) diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 3e4a910c..8201f9d4 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -2627,3 +2627,13 @@ if tp == 'integer' then print(<?x?>) end ]] + +TEST 'integer' [[ +---@type integer? +local x + +if (x == nil) then +else + print(<?x?>) +end +]] |