summaryrefslogtreecommitdiff
path: root/script/files.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-02-04 18:13:19 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-02-04 18:13:19 +0800
commitd72505593952571e27e70a6f81f5db515653e8ee (patch)
treec8fcf9b22ba78dfe3b23424e0aa22952b66cd25e /script/files.lua
parentea009881054fe774a59f440db8da15ce0425a464 (diff)
downloadlua-language-server-d72505593952571e27e70a6f81f5db515653e8ee.zip
print error of plugin;check ignore
Diffstat (limited to 'script/files.lua')
-rw-r--r--script/files.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/script/files.lua b/script/files.lua
index e233846c..93e1e187 100644
--- a/script/files.lua
+++ b/script/files.lua
@@ -107,16 +107,23 @@ local function pluginOnSetText(file, text)
file._diffInfo = nil
local suc, result = plugin.dispatch('OnSetText', file.uri, text)
if not suc then
+ if DEVELOP and result then
+ util.saveFile(LOGPATH .. '/diffed.lua', tostring(result))
+ end
return text
end
if type(result) == 'string' then
return result
elseif type(result) == 'table' then
local diffs
- suc, result, diffs = xpcall(smerger.mergeDiff, log.warn, text, result)
+ suc, result, diffs = xpcall(smerger.mergeDiff, log.error, text, result)
if suc then
file._diffInfo = diffs
return result
+ else
+ if DEVELOP and result then
+ util.saveFile(LOGPATH .. '/diffed.lua', tostring(result))
+ end
end
end
return text