diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-11-02 19:20:22 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-11-02 19:20:22 +0800 |
commit | 02dd5b6557d3e70859bc3ddb234f8924b0166221 (patch) | |
tree | 85a2ff57dc31ba1586542e26bed014514754b089 /script/core/hover/init.lua | |
parent | 63510ae7469aa1cf09da2c356a9feb2ce4be4cd7 (diff) | |
download | lua-language-server-02dd5b6557d3e70859bc3ddb234f8924b0166221.zip |
improve `---@see`
resolve #1344
Diffstat (limited to 'script/core/hover/init.lua')
-rw-r--r-- | script/core/hover/init.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/script/core/hover/init.lua b/script/core/hover/init.lua index 61f09455..2051623c 100644 --- a/script/core/hover/init.lua +++ b/script/core/hover/init.lua @@ -6,6 +6,7 @@ local util = require 'utility' local findSource = require 'core.find-source' local markdown = require 'provider.markdown' local guide = require 'parser.guide' +local wssymbol = require 'core.workspace-symbol' ---@async local function getHover(source) @@ -14,6 +15,15 @@ local function getHover(source) local labelMark = {} local descMark = {} + if source.type == 'doc.see.name' then + for _, symbol in ipairs(wssymbol(source[1])) do + if symbol.name == source[1] then + source = symbol.source + break + end + end + end + ---@async local function addHover(def, checkLable, oop) if defMark[def] then @@ -111,6 +121,7 @@ local accept = { ['doc.enum.name'] = true, ['function'] = true, ['doc.module'] = true, + ['doc.see.name'] = true, } ---@async |