summaryrefslogtreecommitdiff
path: root/server/src/core/rename.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-03-13 18:03:24 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-03-13 18:03:24 +0800
commit2614c2f6e6a53e4142fe57a184fd7bead11a5f4f (patch)
tree17bd6669b19ac260bed90a9dfea241e4117074ff /server/src/core/rename.lua
parent628a272b7babbeab995cf582ff4337b897ac09e6 (diff)
downloadlua-language-server-2614c2f6e6a53e4142fe57a184fd7bead11a5f4f.zip
解除所有的source循环引用
Diffstat (limited to 'server/src/core/rename.lua')
-rw-r--r--server/src/core/rename.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/server/src/core/rename.lua b/server/src/core/rename.lua
index 4e8e574b..b9f692d6 100644
--- a/server/src/core/rename.lua
+++ b/server/src/core/rename.lua
@@ -7,8 +7,8 @@ local function parseResult(source, newName)
if not parser.grammar(newName, 'Name') then
return nil
end
- source:bindLabel():eachInfo(function (info)
- positions[#positions+1] = {info.source.start, info.source.finish}
+ source:bindLabel():eachInfo(function (info, src)
+ positions[#positions+1] = { src.start, src.finish }
end)
return positions
end
@@ -27,10 +27,10 @@ local function parseResult(source, newName)
end
end
local mark = {}
- loc:eachInfo(function (info)
- if not mark[info.source] then
- mark[info.source] = info
- positions[#positions+1] = {info.source.start, info.source.finish}
+ loc:eachInfo(function (info, src)
+ if not mark[src] then
+ mark[src] = info
+ positions[#positions+1] = { src.start, src.finish }
end
end)
return positions