summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-06-11 19:13:38 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-06-11 19:13:38 +0800
commit816a21dd82ee8a533918d8ada4ccd338af3e320b (patch)
tree90ebe3fbc10fcc37605c6c8cd82a214c6049bdfe
parent710ca85aebe3b761e8f03462651ba8ecf629518a (diff)
downloadlua-language-server-816a21dd82ee8a533918d8ada4ccd338af3e320b.zip
update
-rw-r--r--script/core/searcher.lua19
-rw-r--r--test.lua1
2 files changed, 5 insertions, 15 deletions
diff --git a/script/core/searcher.lua b/script/core/searcher.lua
index c782e68c..20713b80 100644
--- a/script/core/searcher.lua
+++ b/script/core/searcher.lua
@@ -418,20 +418,15 @@ function m.searchRefsByID(status, uri, expect, mode)
end
local function checkGlobal(id, node, field)
- if id:sub(1, 2) ~= 'g:' then
- return
- end
- local firstID = noder.getFirstID(id)
- if status.crossed[firstID] then
+ local uris = globals.getUrisByID(id)
+ if not uris then
return
end
- status.crossed[firstID] = true
- local uris = globals.getUrisByID(firstID)
- if not uris then
+ if status.crossed[id] then
return
end
- local clock = os.clock()
- local isCall = id:sub(#firstID + 2, #firstID + 2) == noder.RETURN_INDEX
+ status.crossed[id] = true
+ local isCall = field and field:sub(2, 2) == noder.RETURN_INDEX
local tid = id .. (field or '')
for guri, def in pairs(uris) do
if def then
@@ -453,10 +448,6 @@ function m.searchRefsByID(status, uri, expect, mode)
crossSearch(status, guri, tid, mode)
::CONTINUE::
end
- local passed = os.clock() - clock
- if passed > 0.1 then
- print('全局变量耗时:', passed, id, field, tid, mode)
- end
end
local function checkClass(id, node, field)
diff --git a/test.lua b/test.lua
index 94c5bcf7..fe998a89 100644
--- a/test.lua
+++ b/test.lua
@@ -89,7 +89,6 @@ local function main()
--config.config.intelliSense.searchDepth = 5
loadDocMetas()
- test 'full'
require 'bee.platform'.OS = 'Windows'
testAll()
require 'bee.platform'.OS = 'Linux'