summaryrefslogtreecommitdiff
path: root/script/files.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-01-26 14:53:00 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-01-26 14:53:00 +0800
commit3a14ad38c15c21e61f15330ca8f8c0d76a10459c (patch)
tree32201843dea1ec348135dbc37c7dbfa3f92a1d25 /script/files.lua
parent64022d030508555890daba49502c23ea077fc2c3 (diff)
downloadlua-language-server-3a14ad38c15c21e61f15330ca8f8c0d76a10459c.zip
clean up code
Diffstat (limited to 'script/files.lua')
-rw-r--r--script/files.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/script/files.lua b/script/files.lua
index 7cdbf343..05a7e099 100644
--- a/script/files.lua
+++ b/script/files.lua
@@ -11,6 +11,7 @@ local plugin = require 'plugin'
local util = require 'utility'
local guide = require 'parser.guide'
local smerger = require 'string-merger'
+local plugin = require 'plugin'
local m = {}
@@ -145,6 +146,7 @@ function m.setText(uri, text)
file.text = newText
file.originText = text
m.linesMap[uri] = nil
+ m.originLinesMap[uri] = nil
m.astMap[uri] = nil
file.cache = {}
file.cacheActiveTime = math.huge
@@ -155,6 +157,11 @@ function m.setText(uri, text)
m.onWatch('create', originUri)
end
m.onWatch('update', originUri)
+ if DEVELOP then
+ if text ~= newText then
+ util.saveFile(LOGPATH .. '/diffed.lua', newText)
+ end
+ end
end
--- 获取文件版本