summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-06-17 20:40:48 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-06-17 20:40:48 +0800
commitd24d1eb018787ccdff681e8d5baa33e13e036888 (patch)
treea406871d6ff29855204a709017aedcaf02ccc627 /script
parent77c15299948450fee84b42a5af55328dabf032e4 (diff)
downloadlua-language-server-d24d1eb018787ccdff681e8d5baa33e13e036888.zip
improve
Diffstat (limited to 'script')
-rw-r--r--script/files.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/script/files.lua b/script/files.lua
index a653b364..517cd03d 100644
--- a/script/files.lua
+++ b/script/files.lua
@@ -186,12 +186,20 @@ function m.setText(uri, text, isTrust)
if create then
m.onWatch('create', originUri)
end
- m.onWatch('update', originUri)
if DEVELOP then
if text ~= newText then
util.saveFile(LOGPATH .. '/diffed.lua', newText)
end
end
+
+ await.call(function ()
+ await.close('update:' .. originUri)
+ await.setID('update:' .. originUri)
+ await.delay()
+ if m.exists(originUri) then
+ m.onWatch('update', originUri)
+ end
+ end)
end
function m.setRawText(uri, text)