diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-08-15 17:05:06 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-08-15 17:05:06 +0800 |
commit | 820efa941bfc591c77cafcb4205386ea1795a03e (patch) | |
tree | 8bb6e0a5c642f0a45b37c5a493df8226078b524e /script-beta | |
parent | dd41a923bbe77698f7b44dad2ac29828060341ff (diff) | |
download | lua-language-server-820efa941bfc591c77cafcb4205386ea1795a03e.zip |
更新
Diffstat (limited to 'script-beta')
-rw-r--r-- | script-beta/await.lua | 2 | ||||
-rw-r--r-- | script-beta/parser/guide.lua | 7 | ||||
-rw-r--r-- | script-beta/vm/eachDef.lua | 5 | ||||
-rw-r--r-- | script-beta/vm/eachField.lua | 2 | ||||
-rw-r--r-- | script-beta/vm/eachRef.lua | 5 |
5 files changed, 15 insertions, 6 deletions
diff --git a/script-beta/await.lua b/script-beta/await.lua index 008217c8..5ee9e20b 100644 --- a/script-beta/await.lua +++ b/script-beta/await.lua @@ -110,7 +110,7 @@ function m.step() waker() local passed = os.clock() - clock if passed > 0.1 then - log.debug(('Await step takes [%.3f] sec.'):format(passed)) + log.warn(('Await step takes [%.3f] sec.'):format(passed)) end return true else diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua index 44e97a66..6e3c8a20 100644 --- a/script-beta/parser/guide.lua +++ b/script-beta/parser/guide.lua @@ -1285,6 +1285,13 @@ function m.checkSameSimpleInGlobal(status, name, start, queue) if not status.interface.global then return end + --if not status.cache.globalMark then + -- status.cache.globalMark = {} + --end + --if status.cache.globalMark[name] then + -- return + --end + --status.cache.globalMark[name] = true local objs = status.interface.global(name) if objs then for _, obj in ipairs(objs) do diff --git a/script-beta/vm/eachDef.lua b/script-beta/vm/eachDef.lua index 316a3cb1..2b30c0cd 100644 --- a/script-beta/vm/eachDef.lua +++ b/script-beta/vm/eachDef.lua @@ -24,9 +24,10 @@ function m.eachDef(source, results) return results end + local clock = os.clock() local myResults, count = guide.requestDefinition(source, vm.interface) - if DEVELOP and count > 100 then - log.warn('requestDefinition', count, guide.getRoot(source).uri, util.dump(source, { deep = 1 })) + if DEVELOP and os.clock() - clock > 0.1 then + log.warn('requestDefinition', count, os.clock() - clock, guide.getRoot(source).uri, util.dump(source, { deep = 1 })) end vm.mergeResults(results, myResults) m.searchLibrary(source, results) diff --git a/script-beta/vm/eachField.lua b/script-beta/vm/eachField.lua index 9374865d..2ae9190f 100644 --- a/script-beta/vm/eachField.lua +++ b/script-beta/vm/eachField.lua @@ -21,7 +21,7 @@ local function eachField(source) while source.type == 'paren' do source = source.exp end - local results = guide.requestFields(source) + local results = guide.requestFields(source, vm.interface) local lib = vm.getLibrary(source) if lib then eachFieldInLibrary(source, lib, results) diff --git a/script-beta/vm/eachRef.lua b/script-beta/vm/eachRef.lua index 639d0bc0..65ce4d05 100644 --- a/script-beta/vm/eachRef.lua +++ b/script-beta/vm/eachRef.lua @@ -9,9 +9,10 @@ local function eachRef(source, results) return results end + local clock = os.clock() local myResults, count = guide.requestReference(source, vm.interface) - if DEVELOP and count > 100 then - log.warn('requestReference', count, guide.getRoot(source).uri, util.dump(source, { deep = 1 })) + if DEVELOP and os.clock() - clock > 0.1 then + log.warn('requestReference', count, os.clock() - clock, guide.getRoot(source).uri, util.dump(source, { deep = 1 })) end vm.mergeResults(results, myResults) |