summaryrefslogtreecommitdiff
path: root/server/src/files/file.lua
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-05-20 21:30:07 +0800
committersumneko <sumneko@hotmail.com>2019-05-20 21:30:07 +0800
commitbb5ec0a8fc13ff9c6d12e2a74b75b15705774d0d (patch)
tree996cea667a5c632eac1318f6ef77c4c8c16039b0 /server/src/files/file.lua
parent84dd2f203cde9499c99dcc31b2aa1188d2fa5778 (diff)
downloadlua-language-server-bb5ec0a8fc13ff9c6d12e2a74b75b15705774d0d.zip
暂存一下
Diffstat (limited to 'server/src/files/file.lua')
-rw-r--r--server/src/files/file.lua33
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