summaryrefslogtreecommitdiff
path: root/server/src/matcher/hover.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-27 14:15:09 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-27 14:15:09 +0800
commit3ebc625883cf956179eae4c77305f75b3d24ebd5 (patch)
tree2199ed286fb80788c798037cd78beeac314793c6 /server/src/matcher/hover.lua
parent5cf122870c659821929449d64bfc24d5913dbd77 (diff)
downloadlua-language-server-3ebc625883cf956179eae4c77305f75b3d24ebd5.zip
非函数的hover改成新的格式
Diffstat (limited to 'server/src/matcher/hover.lua')
-rw-r--r--server/src/matcher/hover.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/server/src/matcher/hover.lua b/server/src/matcher/hover.lua
index de2eeffb..99e09e46 100644
--- a/server/src/matcher/hover.lua
+++ b/server/src/matcher/hover.lua
@@ -369,11 +369,18 @@ local function getValueHover(name, valueType, result, source, lib)
value = result.value.value and ('%q'):format(result.value.value)
end
+ local tp = result.type
+ if tp == 'field' then
+ if result.parent.value.ENV then
+ tp = 'global'
+ end
+ end
+
local text
if value == nil then
- text = ('%s %s'):format(valueType, name)
+ text = ('%s %s: %s'):format(tp, name, valueType)
else
- text = ('%s %s = %s'):format(valueType, name, value)
+ text = ('%s %s: %s = %s'):format(tp, name, valueType, value)
end
return {
label = text,