summaryrefslogtreecommitdiff
path: root/server-beta/src/vm/dummySource.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-11-20 21:44:35 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-11-20 21:44:35 +0800
commit6a2ee814158b5e343a8b1f63a26b4de40e29ae2a (patch)
tree8e3b96cd763145dbefae80e94645080732c1ba95 /server-beta/src/vm/dummySource.lua
parentaa710d07d78bb3b908543ec657c93b5672681699 (diff)
downloadlua-language-server-6a2ee814158b5e343a8b1f63a26b4de40e29ae2a.zip
支持 library
Diffstat (limited to 'server-beta/src/vm/dummySource.lua')
-rw-r--r--server-beta/src/vm/dummySource.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/server-beta/src/vm/dummySource.lua b/server-beta/src/vm/dummySource.lua
new file mode 100644
index 00000000..50ff13e7
--- /dev/null
+++ b/server-beta/src/vm/dummySource.lua
@@ -0,0 +1,13 @@
+local vm = require 'vm.vm'
+
+vm.librarySourceCache = setmetatable({}, { __mode = 'kv'})
+
+function vm.librarySource(lib)
+ if not vm.librarySourceCache[lib] then
+ vm.librarySourceCache[lib] = {
+ type = 'library',
+ library = lib,
+ }
+ end
+ return vm.librarySourceCache[lib]
+end