diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-06-24 17:42:28 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-06-24 17:42:28 +0800 |
commit | 0719ce507d89b318405f98872db7689a2ea6097f (patch) | |
tree | 0e3c776ed69a41827967215d7c3e6e62fab7e206 /server/src/files/files.lua | |
parent | 264b0cc598efee9e87132d96596985a09d085798 (diff) | |
download | lua-language-server-0719ce507d89b318405f98872db7689a2ea6097f.zip |
整理代码
Diffstat (limited to 'server/src/files/files.lua')
-rw-r--r-- | server/src/files/files.lua | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/server/src/files/files.lua b/server/src/files/files.lua index 355f81a3..31e5e21b 100644 --- a/server/src/files/files.lua +++ b/server/src/files/files.lua @@ -34,8 +34,8 @@ function mt:remove(uri) end ---@param uri uri -function mt:open(uri) - self._open[uri] = true +function mt:open(uri, text) + self._open[uri] = text end ---@param uri uri @@ -46,7 +46,7 @@ end ---@param uri uri ---@return boolean function mt:isOpen(uri) - return self._open[uri] == true + return self._open[uri] ~= nil end ---@param uri uri @@ -78,10 +78,11 @@ function mt:get(uri) return self._files[uri] end -function mt:clearVM() +function mt:clear() for _, f in pairs(self._files) do - f:removeVM() + f:remove() end + self._files = {} self._library = {} end |