diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-02 21:38:17 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-02 21:38:17 +0800 |
commit | ebb5e55121b023c5eb8bb263edef5adc8b9629bd (patch) | |
tree | 2cfdf11bcd1c65808c0ef0788c1640c9196e7b07 /script-beta | |
parent | d2555c83e1e4338f52a740cbd163fed043219888 (diff) | |
download | lua-language-server-ebb5e55121b023c5eb8bb263edef5adc8b9629bd.zip |
调一下垃圾回收的参数
Diffstat (limited to 'script-beta')
-rw-r--r-- | script-beta/files.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/script-beta/files.lua b/script-beta/files.lua index f1e1de91..ead75079 100644 --- a/script-beta/files.lua +++ b/script-beta/files.lua @@ -358,10 +358,25 @@ function m.flushCache() for _, file in pairs(m.fileMap) do file.cacheActiveTime = math.huge file.ast = nil + file.lines = nil file.cache = {} end end +function m.flushFileCache(uri) + if platform.OS == 'Windows' then + uri = uri:lower() + end + local file = m.fileMap[uri] + if not file then + return + end + file.cacheActiveTime = math.huge + file.ast = nil + file.lines = nil + file.cache = {} +end + local function init() --TODO 可以清空文件缓存,之后看要不要启用吧 --timer.loop(10, function () |