diff --git a/init.lua b/init.lua index 6bd5e65..01b5c84 100644 --- a/init.lua +++ b/init.lua @@ -6,6 +6,8 @@ local LIBRARY = 'pe-lualib' local SERVICE = IsDuplicityVersion() and 'server' or 'client' local IMPORTS = {} +lib = exports[LIBRARY] + local function LoadFile(file) local dir = ('imports/%s'):format(file) local chunk = LoadResourceFile(LIBRARY, ('%s/%s.lua'):format(dir, SERVICE)) diff --git a/resource/main.lua b/resource/main.lua new file mode 100644 index 0000000..b021e9d --- /dev/null +++ b/resource/main.lua @@ -0,0 +1,8 @@ +-- Creates exports from values assigned to lib. +-- Hacky workaround for Lua Language Server support. + +lib = setmetatable({}, { + __newindex = function(self, name, fn) + exports(name, fn) + end +}) \ No newline at end of file