diff options
Diffstat (limited to 'script/core/reference.lua')
-rw-r--r-- | script/core/reference.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/script/core/reference.lua b/script/core/reference.lua index 4c9c193d..fa838cff 100644 --- a/script/core/reference.lua +++ b/script/core/reference.lua @@ -2,6 +2,7 @@ local guide = require 'parser.guide' local files = require 'files' local vm = require 'vm' local findSource = require 'core.find-source' +local jumpSource = require 'core.jump-source' local function sortResults(results) -- 先按照顺序排序 @@ -49,6 +50,7 @@ local accept = { ['doc.class.name'] = true, ['doc.extends.name'] = true, ['doc.alias.name'] = true, + ['doc.enum.name'] = true, } ---@async @@ -101,12 +103,17 @@ return function (uri, position) if src.type == 'doc.alias' then src = src.alias end + if src.type == 'doc.enum' then + src = src.enum + end if src.type == 'doc.class.name' or src.type == 'doc.alias.name' + or src.type == 'doc.enum.name' or src.type == 'doc.type.name' or src.type == 'doc.extends.name' then if source.type ~= 'doc.type.name' and source.type ~= 'doc.class.name' + and source.type ~= 'doc.enum.name' and source.type ~= 'doc.extends.name' and source.type ~= 'doc.see.name' then goto CONTINUE @@ -132,6 +139,7 @@ return function (uri, position) end sortResults(results) + jumpSource(results) return results end |