CppCXY / EmmyLuaAnalyzer

a new EmmyLua Language Server
MIT License
50 stars 10 forks source link

加入机制 类似 inject_module 用于动态注入 #30

Open luxuia opened 3 months ago

luxuia commented 3 months ago
local global = require('global')

--- inject_module global
local indexs = {
    mgr_a = 'module.mgr_a',
    mgr_b = 'module.mgr_b',
}

function mt:init()
    for k, v in pairs(indexs) do
        global[k] = require(v)
    end
end

用于提示模块会被动态注入到global表中. 可能也会有inject_table 之类的需求.

CppCXY commented 3 months ago

以后再说