summaryrefslogtreecommitdiff
path: root/server/src/matcher/hover.lua
diff options
context:
space:
mode:
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,