Skip to content

Commit 2b9fe74

Browse files
committed
fix #1403
1 parent 2a795db commit 2b9fe74

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 3.5.2
44
* `FIX` [#1395](https://github.com/sumneko/lua-language-server/issues/1395)
5+
* `FIX` [#1403](https://github.com/sumneko/lua-language-server/issues/1403)
56

67
## 3.5.1
78
`2022-7-26`

script/core/completion/completion.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2037,7 +2037,9 @@ local function tryluaDocOfFunction(doc, results)
20372037
if not doc.bindSource then
20382038
return
20392039
end
2040-
local func = doc.bindSource.type == 'function' and doc.bindSource or nil
2040+
local func = (doc.bindSource.type == 'function' and doc.bindSource)
2041+
or (doc.bindSource.value and doc.bindSource.value.type == 'function' and doc.bindSource.value)
2042+
or nil
20412043
if not func then
20422044
return
20432045
end

test/completion/common.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3713,3 +3713,9 @@ TEST [[
37133713
(function (results)
37143714
assert(#results > 2)
37153715
end)
3716+
3717+
TEST [[
3718+
---<??>
3719+
local x = function (x, y) end
3720+
]]
3721+
(EXISTS)

0 commit comments

Comments
 (0)