diff options
author | sumneko <sumneko@hotmail.com> | 2019-05-07 14:05:49 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-05-07 14:05:49 +0800 |
commit | a2c3b5915949daf39ddf6f044dbc1a5a64ae9847 (patch) | |
tree | d020f1a14bc31852b2aafd4ed9a5fa8fe2865086 /server/src | |
parent | a6388f8a20b743cbd579c766676023a89317500d (diff) | |
download | lua-language-server-a2c3b5915949daf39ddf6f044dbc1a5a64ae9847.zip |
table.dump加个上限
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/service.lua | 5 | ||||
-rw-r--r-- | server/src/utility.lua | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/server/src/service.lua b/server/src/service.lua index 74124ba6..1c2aec9c 100644 --- a/server/src/service.lua +++ b/server/src/service.lua @@ -57,9 +57,6 @@ function mt:_callMethod(name, params) else local ok, r = pcall(table.dump, params) local dump = ok and r or '<Cyclic table>' - if #dump > 10000 then - dump = '<Large table>' - end log.debug(('Task [%s] failed, params: %s'):format( name, dump )) @@ -518,7 +515,7 @@ function mt:doDiagnostics(uri) lines = obj.lines, version = obj.vmVersion, } - local res = self:_callMethod(name, data) + local res = self:_callMethod(name, data) if self:isDeadText(uri) then return end diff --git a/server/src/utility.lua b/server/src/utility.lua index 0817bc03..d7fc9dde 100644 --- a/server/src/utility.lua +++ b/server/src/utility.lua @@ -61,6 +61,10 @@ function table.dump(tbl) lines[#lines+1] = TAB[tab+1] .. '"<Loop>"' return end + if #lines > 10000 then + lines[#lines+1] = TAB[tab+1] .. '"<Large>"' + return + end mark[tbl] = (mark[tbl] or 0) + 1 local keys = {} local keymap = {} |