summaryrefslogtreecommitdiff
path: root/server/src/matcher
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/matcher')
-rw-r--r--server/src/matcher/hover.lua17
1 files changed, 16 insertions, 1 deletions
diff --git a/server/src/matcher/hover.lua b/server/src/matcher/hover.lua
index bfaead9a..9a556104 100644
--- a/server/src/matcher/hover.lua
+++ b/server/src/matcher/hover.lua
@@ -364,11 +364,26 @@ local function getValueHover(name, valueType, result, source, lib)
]]):format(text, tip)
end
-return function (result, source)
+local function getStringHover(result, lsp)
+ if not result.uri then
+ return nil
+ end
+ if not lsp or not lsp.workspace then
+ return nil
+ end
+ local path = lsp.workspace:relativePathByUri(result.uri)
+ return ('[%s](%s)'):format(path:string(), result.uri)
+end
+
+return function (result, source, lsp)
if not result.value then
return
end
+ if result.type == 'string' then
+ return getStringHover(result, lsp)
+ end
+
local lib, fullKey, oo = findLib(result)
local valueType = lib and lib.type or result.value.type or 'nil'
local name = fullKey or buildValueName(result, source)