summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-04-21 22:03:46 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-04-21 22:03:46 +0800
commit7dd6a5440cb40082f74a865c79d06b2ab8a9c7c1 (patch)
treebda76033195d933d6144a4b8d09475c2341afcb3 /script/core
parentb0c3c3047361c63c7f0c0587ec98964c6a7c4a98 (diff)
downloadlua-language-server-7dd6a5440cb40082f74a865c79d06b2ab8a9c7c1.zip
split
Diffstat (limited to 'script/core')
-rw-r--r--script/core/linker.lua2
-rw-r--r--script/core/searcher.lua5
2 files changed, 3 insertions, 4 deletions
diff --git a/script/core/linker.lua b/script/core/linker.lua
index 3185ecda..ef6dd010 100644
--- a/script/core/linker.lua
+++ b/script/core/linker.lua
@@ -5,7 +5,7 @@ local vm = require 'vm.vm'
local Linkers
local LastIDCache = {}
local SPLIT_CHAR = '\x1F'
-local SPLIT_REGEX = SPLIT_CHAR .. '.-$'
+local SPLIT_REGEX = SPLIT_CHAR .. '[^' .. SPLIT_CHAR .. ']+$'
local INDEX_CHAR = '\x1E'
---是否是全局变量(包括 _G.XXX 形式)
diff --git a/script/core/searcher.lua b/script/core/searcher.lua
index c3d61199..f99b3a4b 100644
--- a/script/core/searcher.lua
+++ b/script/core/searcher.lua
@@ -118,11 +118,10 @@ function m.searchRefsByID(status, uri, expect, mode)
end
local function searchID(id, field)
- search(id, field)
if field then
id = id .. field
- search(id)
end
+ search(id)
end
local function getCallSelectByReturnIndex(func, index)
@@ -200,7 +199,7 @@ function m.searchRefsByID(status, uri, expect, mode)
stackCount = stackCount + 1
local links = linker.getLinksByID(root, id)
if links then
- if stackCount >= 20 then
+ if stackCount >= 100 then
error('stack overflow')
end
for _, eachLink in ipairs(links) do