summaryrefslogtreecommitdiff
path: root/server/src/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-03-15 11:28:55 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-03-15 11:28:55 +0800
commit37c2aaca32959f6c7862d7120379482f3ce811a3 (patch)
treea5ad70081609e00f26d6353fdbe91e325c0a02cb /server/src/core
parent8a35083984d52052aebfbb7283ed62de0d30b79c (diff)
downloadlua-language-server-37c2aaca32959f6c7862d7120379482f3ce811a3.zip
修正寻找引用的bug
Diffstat (limited to 'server/src/core')
-rw-r--r--server/src/core/references.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/src/core/references.lua b/server/src/core/references.lua
index 755612b5..bc6cc39e 100644
--- a/server/src/core/references.lua
+++ b/server/src/core/references.lua
@@ -3,7 +3,7 @@ local findSource = require 'core.find_source'
local function parseResult(vm, source, declarat, callback)
if source:bindLabel() then
source:bindLabel():eachInfo(function (info, src)
- if declarat or info.type == 'get' then
+ if (declarat and info.type == 'set') or info.type == 'get' then
callback(src)
end
end)
@@ -12,12 +12,12 @@ local function parseResult(vm, source, declarat, callback)
if source:bindLocal() then
local loc = source:bindLocal()
loc:eachInfo(function (info, src)
- if declarat or info.type == 'get' then
+ if (declarat and info.type == 'set') or info.type == 'get' then
callback(src)
end
end)
loc:getValue():eachInfo(function (info, src)
- if declarat or info.type == 'get' then
+ if (declarat and (info.type == 'set' or info.type == 'local')) or info.type == 'get' then
callback(src)
end
end)
@@ -25,7 +25,7 @@ local function parseResult(vm, source, declarat, callback)
end
if source:bindValue() then
source:bindValue():eachInfo(function (info, src)
- if declarat or info.type == 'get' then
+ if (declarat and (info.type == 'set' or info.type == 'local')) or info.type == 'get' then
callback(src)
end
end)