summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/core/hover/description.lua5
-rw-r--r--test/crossfile/hover.lua17
2 files changed, 21 insertions, 1 deletions
diff --git a/script/core/hover/description.lua b/script/core/hover/description.lua
index 51cf2caa..1f276864 100644
--- a/script/core/hover/description.lua
+++ b/script/core/hover/description.lua
@@ -97,7 +97,10 @@ local function normalizeComment(comment, suri)
return nil
end
comment = comment:gsub('(%[.-%]%()(.-)(%))', function (left, path, right)
- if furi.split(path) then
+ local scheme = furi.split(path)
+ if scheme
+ -- strange way to check `C:/xxx.lua`
+ and #scheme > 1 then
return
end
local absPath = ws.getAbsolutePath(suri:gsub('/[^/]+$', ''), path)
diff --git a/test/crossfile/hover.lua b/test/crossfile/hover.lua
index fe6e7233..3c62b8f8 100644
--- a/test/crossfile/hover.lua
+++ b/test/crossfile/hover.lua
@@ -1343,3 +1343,20 @@ local n: unknown
---
[here](file:///d%3A/x.lua)]]
}
+
+TEST {
+ {
+ path = 'a.lua',
+ content = [[
+ --[here](command:xxxxx)
+ local <?n?>
+ ]]
+ },
+ hover = [[
+```lua
+local n: unknown
+```
+
+---
+[here](command:xxxxx)]]
+}