diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-12-14 15:54:35 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-12-14 15:54:35 +0800 |
commit | bbd6f89a2a024e4b9fa7f7f1f5cd5564187c622b (patch) | |
tree | c95d327ef00296f346e7c7dba53a0450df329791 /script-beta/core | |
parent | 0824ee5122f50b824bc677a8838b3e1d0102258e (diff) | |
download | lua-language-server-bbd6f89a2a024e4b9fa7f7f1f5cd5564187c622b.zip |
整理ref实现
Diffstat (limited to 'script-beta/core')
-rw-r--r-- | script-beta/core/reference.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/script-beta/core/reference.lua b/script-beta/core/reference.lua index 0f4efbfc..6edd63a7 100644 --- a/script-beta/core/reference.lua +++ b/script-beta/core/reference.lua @@ -72,8 +72,13 @@ return function (uri, offset) return nil end local results = {} + local mark = {} guide.eachSourceContain(ast.ast, offset, function (source) findRef(source, offset, function (target, uri) + if mark[target] then + return + end + mark[target] = true results[#results+1] = { target = target, uri = files.getOriginUri(uri), |