summaryrefslogtreecommitdiff
path: root/server/src
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
parent8a35083984d52052aebfbb7283ed62de0d30b79c (diff)
downloadlua-language-server-37c2aaca32959f6c7862d7120379482f3ce811a3.zip
修正寻找引用的bug
Diffstat (limited to 'server/src')
-rw-r--r--server/src/core/references.lua8
-rw-r--r--server/src/service.lua1
2 files changed, 4 insertions, 5 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)
diff --git a/server/src/service.lua b/server/src/service.lua
index 8b07aa33..20e1a921 100644
--- a/server/src/service.lua
+++ b/server/src/service.lua
@@ -534,7 +534,6 @@ function mt:onTick()
self:_doCompileTask()
if os.clock() - self._clock >= 60 then
- collectgarbage()
self._clock = os.clock()
local count = 0
for _ in pairs(self._file) do