Skip to content

Commit 1b54172

Browse files
committed
Remove varargs from new() and recommend treating LoadModule like require using config
1 parent 65b844a commit 1b54172

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

CONTRIBUTING.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,10 @@ Files in `/Data` `/Export` and `/TreeData` can be massive and cause the EmmyLua
208208
{
209209
"$schema": "https://raw.githubusercontent.com/EmmyLuaLs/emmylua-analyzer-rust/refs/heads/main/crates/emmylua_code_analysis/resources/schema.json",
210210
"runtime": {
211-
"version": "LuaJIT"
211+
"version": "LuaJIT",
212+
// this is not technically correct as LoadModule behaviour can
213+
// differ from require, but it is useful for now
214+
"requireLikeFunction": ["LoadModule"],
212215
},
213216
"workspace": {
214217
"ignoreGlobs": [
@@ -246,7 +249,12 @@ If you prefer to not use EmmyLua, the following configuration works well for Sum
246249
// disables diagnostics even when you open one of the above
247250
"Lua.diagnostics.ignoredFiles": "Disable",
248251
"Lua.runtime.version": "LuaJIT",
249-
"Lua.workspace.preloadFileSize": 1000
252+
"Lua.workspace.preloadFileSize": 1000,
253+
// this is not technically correct as LoadModule behaviour can
254+
// differ from require, but it is useful for now
255+
"Lua.runtime.special": {
256+
"LoadModule": "require"
257+
},
250258
}
251259
```
252260

src/Modules/Common.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ end
120120
---@generic T
121121
---@param className `T`
122122
---@return T
123-
function new(className, ...)
123+
function new(className)
124124
local class = getClass(className)
125125
local object = setmetatable({ }, class)
126126
object.Object = object

0 commit comments

Comments
 (0)