summaryrefslogtreecommitdiff
path: root/script/files.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-02-01 19:11:45 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-02-01 19:11:45 +0800
commitb02b3fe1dc20a560146548bbf766e3b49076df66 (patch)
treed7d1a071be73b4ddaffc7b8ce7f51f1fedc6f354 /script/files.lua
parent75ccd8ae4272c2b193df3993f7d4e6819ff66ac7 (diff)
downloadlua-language-server-b02b3fe1dc20a560146548bbf766e3b49076df66.zip
try file operations event
Diffstat (limited to 'script/files.lua')
-rw-r--r--script/files.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/script/files.lua b/script/files.lua
index 0817887f..60119b8d 100644
--- a/script/files.lua
+++ b/script/files.lua
@@ -217,8 +217,11 @@ function m.remove(uri)
end
m.fileMap[uri] = nil
m._pairsCache = nil
+ m.flushFileCache(uri)
+ m.fileCount = m.fileCount - 1
m.globalVersion = m.globalVersion + 1
+
await.close('files.version')
m.onWatch('remove', originUri)
end
@@ -797,6 +800,7 @@ function m.flushCache()
for uri, file in pairs(m.fileMap) do
file.cacheActiveTime = math.huge
m.linesMap[uri] = nil
+ m.originLinesMap[uri] = nil
m.astMap[uri] = nil
file.cache = {}
end
@@ -810,6 +814,7 @@ function m.flushFileCache(uri)
end
file.cacheActiveTime = math.huge
m.linesMap[uri] = nil
+ m.originLinesMap[uri] = nil
m.astMap[uri] = nil
file.cache = {}
end