summaryrefslogtreecommitdiff
path: root/script-beta/core/hover/name.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-20 19:10:30 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-20 19:10:30 +0800
commit9cd44e1b61fa8f002b211224e0141812a8fc97e6 (patch)
treeea40fba54f00d294e25803e6fb82bcefcd0419df /script-beta/core/hover/name.lua
parent1dfeaffc5df3a8e1c4585374fa8f6ab252221b40 (diff)
downloadlua-language-server-9cd44e1b61fa8f002b211224e0141812a8fc97e6.zip
stage
Diffstat (limited to 'script-beta/core/hover/name.lua')
-rw-r--r--script-beta/core/hover/name.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/script-beta/core/hover/name.lua b/script-beta/core/hover/name.lua
index e5bd6f66..ee8b3961 100644
--- a/script-beta/core/hover/name.lua
+++ b/script-beta/core/hover/name.lua
@@ -84,6 +84,10 @@ local function asDocFunction(source)
return ''
end
+local function asDocField(source)
+ return source.field[1]
+end
+
function buildName(source, oop)
if oop == nil then
oop = source.type == 'setmethod'
@@ -117,6 +121,9 @@ function buildName(source, oop)
if source.type == 'doc.type.function' then
return asDocFunction(source)
end
+ if source.type == 'doc.field' then
+ return asDocField(source)
+ end
local parent = source.parent
if parent then
return buildName(parent, oop)