object luals annotation

This commit is contained in:
yuki 2025-11-09 19:45:08 -03:00
parent 16b4cd92d8
commit df994fb05e
3 changed files with 33 additions and 7 deletions

View file

@ -1,5 +0,0 @@
{
"Lua.diagnostics.disable": [
"lowercase-global"
]
}

24
def/Object.d.lua Normal file
View file

@ -0,0 +1,24 @@
---@diagnostic disable: undefined-field
---@meta
---@module 'classic'
---@class Object
local Object = {}
---Create a new instance of the class.
---@return self
function Object:new(...) end
---Call the super-class constructor.
---@param self Object
function Object.super.new(self, ...) end
---Create a subclass.
---@return Object # the new subclass (its metatable is set up)
function Object:extend() end
---Mix-in a table of methods into the class.
---@param mixin table
function Object:implement(mixin) end
return Object

View file

@ -10,8 +10,15 @@
"love.filesystem.load": "loadfile"
},
"Lua.diagnostics.globals": ["love"],
"Lua.workspace.library": ["${3rd}/love2d/library"],
"Lua.workspace.checkThirdParty": true
"Lua.workspace.library": [
"${3rd}/love2d/library",
"${3rd}/classic",
"${workspaceFolder}/def"
],
"Lua.workspace.checkThirdParty": true,
"Lua.diagnostics.disable": [
"lowercase-global"
]
},
"launch": {
"version": "0.2.0",