diff options
-rw-r--r-- | script/core/searcher.lua | 19 | ||||
-rw-r--r-- | test.lua | 1 |
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) @@ -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' |