diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-11-02 20:54:24 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-11-02 20:54:24 +0800 |
commit | fbb038b568fffe8ddbf6946cd0f7d49a624b496a (patch) | |
tree | 89314f1f0261075c7902cbeefeb9f6de60867700 /script/core | |
parent | 95437dacc0ecfdf7ee6c4b158fbba6dbc21aecd3 (diff) | |
download | lua-language-server-fbb038b568fffe8ddbf6946cd0f7d49a624b496a.zip |
async doc.type.function
Diffstat (limited to 'script/core')
-rw-r--r-- | script/core/hover/init.lua | 5 | ||||
-rw-r--r-- | script/core/hover/label.lua | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/script/core/hover/init.lua b/script/core/hover/init.lua index f0160ab5..7d99a006 100644 --- a/script/core/hover/init.lua +++ b/script/core/hover/init.lua @@ -39,12 +39,17 @@ local function getHover(source) end if infer.searchAndViewInfers(source) == 'function' then + local hasFunc for _, def in ipairs(vm.getDefs(source)) do if def.type == 'function' or def.type == 'doc.type.function' then + hasFunc = true addHover(def, true) end end + if not hasFunc then + addHover(source, true) + end else addHover(source, true) for _, def in ipairs(vm.getDefs(source)) do diff --git a/script/core/hover/label.lua b/script/core/hover/label.lua index 803b9596..0bb4fe89 100644 --- a/script/core/hover/label.lua +++ b/script/core/hover/label.lua @@ -64,6 +64,9 @@ local function asValue(source, title) local pack = {} pack[#pack+1] = title pack[#pack+1] = name .. ':' + if vm.isAsync(source, true) then + pack[#pack+1] = 'async' + end if cont and ( type == 'table' or type == 'any' |