summaryrefslogtreecommitdiff
path: root/script-beta/core/hover
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-18 13:17:47 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-18 13:17:47 +0800
commitdb4b65088600f08d254bb96779a4855752f2216b (patch)
tree140df242901647c30a75abb836282773ffbca930 /script-beta/core/hover
parentdca229298e345d0ba6e2b4294789f7c1cb0c75bb (diff)
downloadlua-language-server-db4b65088600f08d254bb96779a4855752f2216b.zip
从定义里找函数描述
Diffstat (limited to 'script-beta/core/hover')
-rw-r--r--script-beta/core/hover/description.lua4
-rw-r--r--script-beta/core/hover/init.lua2
2 files changed, 2 insertions, 4 deletions
diff --git a/script-beta/core/hover/description.lua b/script-beta/core/hover/description.lua
index 39cfb07b..98b5c6ea 100644
--- a/script-beta/core/hover/description.lua
+++ b/script-beta/core/hover/description.lua
@@ -252,10 +252,6 @@ local function getBindEnums(source)
end
local function tryDocComment(source)
- if source.type == 'field'
- or source.type == 'method' then
- source = source.parent
- end
if not source.bindDocs then
return
end
diff --git a/script-beta/core/hover/init.lua b/script-beta/core/hover/init.lua
index 6436169a..92197ab6 100644
--- a/script-beta/core/hover/init.lua
+++ b/script-beta/core/hover/init.lua
@@ -28,11 +28,13 @@ local function getHoverAsFunction(source)
protos = protos + 1
end
end
+ desc = desc or getDesc(value)
elseif value.type == 'table'
or value.type == 'boolean'
or value.type == 'string'
or value.type == 'number' then
other = other + 1
+ desc = desc or getDesc(value)
end
end