summaryrefslogtreecommitdiff
path: root/server/src/core/document_symbol.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-03-13 17:18:32 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-03-13 17:18:32 +0800
commit628a272b7babbeab995cf582ff4337b897ac09e6 (patch)
treede859adf802e7ea941cf990007e40d98a1fee77b /server/src/core/document_symbol.lua
parent42ec4d53d770a053c0909f14b5aa7c8cd42bbcdb (diff)
downloadlua-language-server-628a272b7babbeab995cf582ff4337b897ac09e6.zip
解除value->info->source的循环引用
Diffstat (limited to 'server/src/core/document_symbol.lua')
-rw-r--r--server/src/core/document_symbol.lua11
1 files changed, 4 insertions, 7 deletions
diff --git a/server/src/core/document_symbol.lua b/server/src/core/document_symbol.lua
index 2b1ecfbf..8225fdb9 100644
--- a/server/src/core/document_symbol.lua
+++ b/server/src/core/document_symbol.lua
@@ -35,18 +35,15 @@ local function isFirstSet(source, value)
if source:action() ~= 'set' then
return false
end
- local firstSet = value:eachInfo(function (info)
+ local firstSrc = value:eachInfo(function (info, src)
if info.type == 'set' then
- return info
+ return src
end
end)
- if not firstSet then
+ if not firstSrc then
return false
end
- if firstSet.type ~= 'set' then
- return false
- end
- if firstSet.source ~= source then
+ if firstSrc ~= source then
return false
end
return true