diff options
author | CppCXY <812125110@qq.com> | 2022-08-11 19:36:36 +0800 |
---|---|---|
committer | CppCXY <812125110@qq.com> | 2022-08-11 19:36:36 +0800 |
commit | ff9103ae4001d8e520171b99cd192997fc689bc9 (patch) | |
tree | 04c0b685e81aac48210604dc12d24b91862a36d9 /script/core/reference.lua | |
parent | 40f191a85ea21bb64c427f9dab4bc597e2a0ea1b (diff) | |
parent | 82bcfef9037c26681993c94b2f92b68d335de3c6 (diff) | |
download | lua-language-server-ff9103ae4001d8e520171b99cd192997fc689bc9.zip |
Merge branch 'master' of github.com:CppCXY/lua-language-server
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 |