diff options
-rw-r--r-- | server/main.lua | 2 | ||||
-rw-r--r-- | server/src/plugin.lua | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/server/main.lua b/server/main.lua index 99143461..afb32f03 100644 --- a/server/main.lua +++ b/server/main.lua @@ -15,7 +15,7 @@ log.info('Lua Lsp startup, root: ', ROOT) log.debug('ROOT:', ROOT:string()) ac = {} -xpcall(dofile, log.debug, rootPath .. '/debugger.lua') +--xpcall(dofile, log.debug, rootPath .. '/debugger.lua') require 'utility' local service = require 'service' local session = service() diff --git a/server/src/plugin.lua b/server/src/plugin.lua index 303c2dda..7740c2d9 100644 --- a/server/src/plugin.lua +++ b/server/src/plugin.lua @@ -75,6 +75,18 @@ local function load(workspace) end) end +local function call(name, ...) + for _, plugin in ipairs(Plugins) do + if type(plugin[name]) == 'function' then + local suc, res = xpcall(plugin[name], showError, ...) + if suc and res then + return res + end + end + end +end + return { load = load, + call = call, } |