summaryrefslogtreecommitdiff
path: root/script-beta
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-08-15 16:29:09 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-08-15 16:29:09 +0800
commitdd41a923bbe77698f7b44dad2ac29828060341ff (patch)
treee2a1a97ae22e519819e5622be7ac0100136dcd02 /script-beta
parent081ad3c0c8cc7935d5e5aa52e2a4c2bcc47f3402 (diff)
downloadlua-language-server-dd41a923bbe77698f7b44dad2ac29828060341ff.zip
修改一下诊断格式
Diffstat (limited to 'script-beta')
-rw-r--r--script-beta/utility.lua3
-rw-r--r--script-beta/vm/eachDef.lua4
-rw-r--r--script-beta/vm/eachRef.lua4
3 files changed, 6 insertions, 5 deletions
diff --git a/script-beta/utility.lua b/script-beta/utility.lua
index eb263327..bffefec9 100644
--- a/script-beta/utility.lua
+++ b/script-beta/utility.lua
@@ -15,6 +15,7 @@ local getmetatable = getmetatable
local mathAbs = math.abs
local ioOpen = io.open
local utf8Len = utf8.len
+local mathHuge = math.huge
_ENV = nil
@@ -141,7 +142,7 @@ function m.dump(tbl, option)
elseif tp == 'table' then
if mark[value] and mark[value] > 0 then
lines[#lines+1] = ('%s%s%s,'):format(TAB[deep+1], keyWord, option['loop'] or '"<Loop>"')
- elseif deep > (option['deep'] or math.huge) then
+ elseif deep >= (option['deep'] or mathHuge) then
lines[#lines+1] = ('%s%s%s,'):format(TAB[deep+1], keyWord, '"<Deep>"')
else
lines[#lines+1] = ('%s%s{'):format(TAB[deep+1], keyWord)
diff --git a/script-beta/vm/eachDef.lua b/script-beta/vm/eachDef.lua
index dfd6ce1a..316a3cb1 100644
--- a/script-beta/vm/eachDef.lua
+++ b/script-beta/vm/eachDef.lua
@@ -25,8 +25,8 @@ function m.eachDef(source, results)
end
local myResults, count = guide.requestDefinition(source, vm.interface)
- if DEVELOP and count > 10 then
- log.warn('requestDefinition', count, util.dump(source, { deep = 0 }))
+ if DEVELOP and count > 100 then
+ log.warn('requestDefinition', count, guide.getRoot(source).uri, util.dump(source, { deep = 1 }))
end
vm.mergeResults(results, myResults)
m.searchLibrary(source, results)
diff --git a/script-beta/vm/eachRef.lua b/script-beta/vm/eachRef.lua
index d86bba0a..639d0bc0 100644
--- a/script-beta/vm/eachRef.lua
+++ b/script-beta/vm/eachRef.lua
@@ -10,8 +10,8 @@ local function eachRef(source, results)
end
local myResults, count = guide.requestReference(source, vm.interface)
- if DEVELOP and count > 10 then
- log.warn('requestReference', count, util.dump(source, { deep = 0 }))
+ if DEVELOP and count > 100 then
+ log.warn('requestReference', count, guide.getRoot(source).uri, util.dump(source, { deep = 1 }))
end
vm.mergeResults(results, myResults)