diff options
-rw-r--r-- | changelog.md | 1 | ||||
-rw-r--r-- | script/core/completion/completion.lua | 4 | ||||
-rw-r--r-- | test/completion/common.lua | 6 |
3 files changed, 10 insertions, 1 deletions
diff --git a/changelog.md b/changelog.md index 1a060a3e..7eeba2b9 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,7 @@ ## 3.5.2 * `FIX` [#1395](https://github.com/sumneko/lua-language-server/issues/1395) +* `FIX` [#1403](https://github.com/sumneko/lua-language-server/issues/1403) ## 3.5.1 `2022-7-26` diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua index 71f38645..76c8ba2e 100644 --- a/script/core/completion/completion.lua +++ b/script/core/completion/completion.lua @@ -2037,7 +2037,9 @@ local function tryluaDocOfFunction(doc, results) if not doc.bindSource then return end - local func = doc.bindSource.type == 'function' and doc.bindSource or nil + local func = (doc.bindSource.type == 'function' and doc.bindSource) + or (doc.bindSource.value and doc.bindSource.value.type == 'function' and doc.bindSource.value) + or nil if not func then return end diff --git a/test/completion/common.lua b/test/completion/common.lua index 997ebd14..f1100e36 100644 --- a/test/completion/common.lua +++ b/test/completion/common.lua @@ -3713,3 +3713,9 @@ TEST [[ (function (results) assert(#results > 2) end) + +TEST [[ +---<??> +local x = function (x, y) end +]] +(EXISTS) |