diff options
author | sumneko <sumneko@hotmail.com> | 2019-05-20 21:30:07 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-05-20 21:30:07 +0800 |
commit | bb5ec0a8fc13ff9c6d12e2a74b75b15705774d0d (patch) | |
tree | 996cea667a5c632eac1318f6ef77c4c8c16039b0 /server/src/files/file.lua | |
parent | 84dd2f203cde9499c99dcc31b2aa1188d2fa5778 (diff) | |
download | lua-language-server-bb5ec0a8fc13ff9c6d12e2a74b75b15705774d0d.zip |
暂存一下
Diffstat (limited to 'server/src/files/file.lua')
-rw-r--r-- | server/src/files/file.lua | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/server/src/files/file.lua b/server/src/files/file.lua new file mode 100644 index 00000000..e8cd783b --- /dev/null +++ b/server/src/files/file.lua @@ -0,0 +1,33 @@ +local mt = {} +mt.__index = mt +mt.type = 'file' +mt._uri = '' +mt._text = '' +mt._open = false + +function mt:setText(buf) + self._text = buf +end + +function mt:getText() + return self._text +end + +function mt:open() + self._open = true +end + +function mt:close() + self._open = false +end + +function mt:isOpen() + return self._open +end + +return function (uri) + local self = setmetatable({ + _uri = uri, + }, mt) + return self +end |