diff --git a/.emmyrc.json b/.emmyrc.json index fa2d5da..a8dbc05 100644 --- a/.emmyrc.json +++ b/.emmyrc.json @@ -1,97 +1,96 @@ { - "completion": { - "enable": true, - "autoRequire": false, - "autoRequireFunction": "require", - "autoRequireNamingConvention": "keep", - "autoRequireSeparator": ".", - "callSnippet": false, - "postfix": "@" - }, - "diagnostics": { - "disable": [ - "unnecessary-if" - ], - "enable": true, - "globals": [ - "core", - "table", - "VoxelArea", - "VoxelManip", - "vector", - "Ensure", - "string", - "string_utf8" - ], - "globalsRegex": [], - "severity": {}, - "enables": [], - "diagnosticInterval": 1 - }, - "signature": { - "detailSignatureHelper": true - }, - "hint": { - "enable": true, - "paramHint": true, - "indexHint": true, - "localHint": true, - "overrideHint": true - }, - "runtime": { - "version": "LuaJIT", - "requireLikeFunction": [], - "frameworkVersions": [], - "extensions": [], - "requirePattern": [], - "classDefaultCall": { - "functionName": "", - "forceNonColon": false, - "forceReturnSelf": false - } - }, - "workspace": { - "ignoreDir": [], - "ignoreGlobs": [], - "library": [], - "workspaceRoots": [], - "preloadFileSize": 0, - "encoding": "utf-8", - "moduleMap": [], - "reindexDuration": 5000, - "enableReindex": false - }, - "resource": { - "paths": [] - }, - "codeLens": { - "enable": true - }, - "strict": { - "requirePath": false, - "typeCall": false, - "arrayIndex": true, - "metaOverrideFileDefine": true, - "docBaseConstMatchBaseType": true - }, - "semanticTokens": { - "enable": true - }, - "references": { - "enable": true, - "fuzzySearch": true, - "shortStringSearch": false - }, - "hover": { - "enable": true - }, - "documentColor": { - "enable": true - }, - "codeAction": { - "insertSpace": false - }, - "workspace.library": [ - "util/ide-helper" - ] -} \ No newline at end of file + "codeAction": { + "insertSpace": false + }, + "codeLens": { + "enable": true + }, + "completion": { + "autoRequire": false, + "autoRequireFunction": "require", + "autoRequireNamingConvention": "keep", + "autoRequireSeparator": ".", + "callSnippet": false, + "enable": true, + "postfix": "@" + }, + "diagnostics": { + "diagnosticInterval": 1, + "disable": [ + "unnecessary-if", + "redefined-local" + ], + "enable": true, + "enables": [], + "globals": [ + "core", + "table", + "VoxelArea", + "VoxelManip", + "vector", + "Ensure", + "string", + "string_utf8" + ], + "globalsRegex": [] + }, + "documentColor": { + "enable": true + }, + "hint": { + "enable": true, + "indexHint": true, + "localHint": true, + "overrideHint": true, + "paramHint": true + }, + "hover": { + "enable": true + }, + "references": { + "enable": true, + "fuzzySearch": true, + "shortStringSearch": false + }, + "resource": { + "paths": [] + }, + "runtime": { + "classDefaultCall": { + "forceNonColon": false, + "forceReturnSelf": false, + "functionName": "" + }, + "extensions": [], + "frameworkVersions": [], + "requireLikeFunction": [], + "requirePattern": [], + "version": "LuaJIT" + }, + "semanticTokens": { + "enable": true + }, + "signature": { + "detailSignatureHelper": true + }, + "strict": { + "arrayIndex": true, + "docBaseConstMatchBaseType": true, + "metaOverrideFileDefine": true, + "requirePath": false, + "typeCall": false + }, + "workspace": { + "enableReindex": false, + "encoding": "utf-8", + "ignoreDir": [], + "ignoreGlobs": [], + "library": [ + "util/ide-helper" + ], + "moduleMap": [], + "preloadFileSize": 0, + "reindexDuration": 5000, + "workspaceRoots": [] + } + } diff --git a/mods/API/Mod/init.lua b/mods/API/Mod/init.lua index 998707f..8eb9317 100644 --- a/mods/API/Mod/init.lua +++ b/mods/API/Mod/init.lua @@ -3,7 +3,7 @@ ---@field name string Technical name of the mod. ---@field shortName string ---@field path string Path to the mod folder. ----@field Class table A public class that provides a mod. +---@field Class any A public class that provides a mod. ---@field require fun(FileName:string):table Mod = {} @@ -17,9 +17,10 @@ local function getShortModName(name) end ---Return table with mod name, path and require function. +---@param modname? string Specify a name of mod to get its info ---@return {name: string, shortName: string, path: string, require: fun(FileName : string): table} -function Mod.getInfo() - local name = core.get_current_modname() +function Mod.getInfo(modname) + local name = modname or core.get_current_modname() local shortName = getShortModName(name) local path = core.get_modpath(name) local require = Require.getModRequire(name, path) @@ -61,4 +62,3 @@ function Mod:getModClassExtended(ChildClass) return childClass end - diff --git a/mods/CORE/Item/src/Item.lua b/mods/CORE/Item/src/Item.lua index 5413e9e..34e9872 100644 --- a/mods/CORE/Item/src/Item.lua +++ b/mods/CORE/Item/src/Item.lua @@ -1,5 +1,5 @@ -local modInfo = Mod.getInfo() -local require = modInfo.require +local modInfo = Mod.getInfo() +local require = modInfo.require local VisualEnum = require('Item.VisualEnum')