summaryrefslogtreecommitdiff
path: root/script/provider/provider.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-09-27 16:31:08 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-09-27 16:31:08 +0800
commitd97cc79697ab8c59e340cd9b85a29ad122e370c2 (patch)
treee95db8ad244a8e22511385ef25384166e3f0a00f /script/provider/provider.lua
parent2f4f3e185b82ac16364e3a6150b8e1a7c5b1cdf9 (diff)
downloadlua-language-server-d97cc79697ab8c59e340cd9b85a29ad122e370c2.zip
some fix
Diffstat (limited to 'script/provider/provider.lua')
-rw-r--r--script/provider/provider.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index 3f64494d..83e2b7da 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -855,3 +855,14 @@ config.watch(function (key, value)
end
end
end)
+
+files.watch(function (ev, uri)
+ if ev == 'update'
+ or ev == 'remove' then
+ for id, p in pairs(proto.holdon) do
+ if p.params.textDocument and p.params.textDocument.uri == uri then
+ proto.close(id, define.ErrorCodes.ContentModified)
+ end
+ end
+ end
+end)