Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generated engine docs and types for Lua Language Server #3949

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .luarc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"runtime.version": "Lua 5.1",
"completion.requireSeparator": "/",
"workspace.library": [
"library"
],
"runtime.path": [
"?",
"?.lua"
Expand Down
10 changes: 10 additions & 0 deletions library/LuaArchive.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

---!!! DO NOT MANUALLY EDIT THIS FILE !!!
---Generated by lua-doc-extractor 0.0.1
---https://github.com/rhys-vdw/lua-doc-extractor
---
---Date: Wed, 20 Nov 2024 13:06:36 GMT
---Source: rts/Lua/LuaArchive.cpp
---
---@meta

10 changes: 10 additions & 0 deletions library/LuaAtlasTextures.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

---!!! DO NOT MANUALLY EDIT THIS FILE !!!
---Generated by lua-doc-extractor 0.0.1
---https://github.com/rhys-vdw/lua-doc-extractor
---
---Date: Wed, 20 Nov 2024 13:06:36 GMT
---Source: rts/Lua/LuaAtlasTextures.cpp
---
---@meta

65 changes: 65 additions & 0 deletions library/LuaBitOps.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

---!!! DO NOT MANUALLY EDIT THIS FILE !!!
---Generated by lua-doc-extractor 0.0.1
---https://github.com/rhys-vdw/lua-doc-extractor
---
---Date: Wed, 20 Nov 2024 13:06:36 GMT
---Source: rts/Lua/LuaBitOps.cpp
---
---@meta

---math bit extensions
---
---Note: there are no bit shift. Use those Lua functions instead for 24 bits bitshift
---24 bits because only the 24 bits of the mantissa can be easily used in a 32 bit float
---bitshift functions (<<, >> equivalent)
---
----- left shift
---local function lsh(value,shift)
---return (value*(2^shift)) % 2^24
---end
---
----- right shift
---local function rsh(value,shift)
---return math.floor(value/2^shift) % 2^24
---end
---
---@see rts/Lua/LuaBitOps.cpp

---Returns the bitwise OR of all arguments. Only use up to 24 bit integers.
---
---@param a1 integer
---@param a2 integer
---@param ... integer
---@return integer result
function math.bit_or(a1, a2, ...) end

---Returns the bitwise AND of all arguments. Only use up to 24 bit integers.
---
---@param a1 integer
---@param a2 integer
---@param ... integer
---@return integer result
function math.bit_and(a1, a2, ...) end

---Returns the bitwise XOR of all arguments. Only use up to 24 bit integers.
---
---@param a1 integer
---@param a2 integer
---@param ... integer
---@return integer result
function math.bit_xor(a1, a2, ...) end

---Returns the bitwise NOT of the 24 bit integer argument.
---
---@param value integer
---@return integer result
function math.bit_inv(value) end

---Set each of the bits of a 24 bit integer. Returns result = result OR (1 << a1) OR (1 << a2) OR ...;)
---
---@param a1 integer
---@param a2 integer
---@param ... integer
---@return integer result
function math.bit_bits(a1, a2, ...) end
202 changes: 202 additions & 0 deletions library/LuaConstCMD.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@

---!!! DO NOT MANUALLY EDIT THIS FILE !!!
---Generated by lua-doc-extractor 0.0.1
---https://github.com/rhys-vdw/lua-doc-extractor
---
---Date: Wed, 20 Nov 2024 13:06:36 GMT
---Source: rts/Lua/LuaConstCMD.cpp
---
---@meta

---Command constants
---
---@see rts/Lua/LuaConstCMD.cpp

---@enum CMD
CMD = {
---@type -1
FIRESTATE_NONE = nil,

---@type -1
MOVESTATE_NONE = nil,

---@type 0
STOP = nil,

---@type 0
MOVESTATE_HOLDPOS = nil,

---@type 0
FIRESTATE_HOLDFIRE = nil,

---@type 1
INSERT = nil,

---@type 1
MOVESTATE_MANEUVER = nil,

---@type 1
FIRESTATE_RETURNFIRE = nil,

---@type 1
WAITCODE_TIME = nil,

---@type 2
WAITCODE_DEATH = nil,

---@type 2
MOVESTATE_ROAM = nil,

---@type 2
REMOVE = nil,

---@type 2
FIRESTATE_FIREATWILL = nil,

---@type 3
FIRESTATE_FIREATNEUTRAL = nil,

---@type 3
WAITCODE_SQUAD = nil,

---@type 4
OPT_META = nil,

---@type 4
WAITCODE_GATHER = nil,

---@type 5
WAIT = nil,

---@type 6
TIMEWAIT = nil,

---@type 7
DEATHWAIT = nil,

---@type 8
OPT_INTERNAL = nil,

---@type 8
SQUADWAIT = nil,

---@type 9
GATHERWAIT = nil,

---@type 10
MOVE = nil,

---@type 15
PATROL = nil,

---@type 16
FIGHT = nil,

---@type 16
OPT_RIGHT = nil,

---@type 20
LOOPBACKATTACK = nil,

---@type 20
ATTACK = nil,

---@type 21
AREA_ATTACK = nil,

---@type 25
GUARD = nil,

---@type 30
AISELECT = nil,

---@type 32
OPT_SHIFT = nil,

---@type 35
GROUPSELECT = nil,

---@type 36
GROUPADD = nil,

---@type 37
GROUPCLEAR = nil,

---@type 40
REPAIR = nil,

---@type 45
FIRE_STATE = nil,

---@type 50
MOVE_STATE = nil,

---@type 55
SETBASE = nil,

---@type 60
INTERNAL = nil,

---@type 64
OPT_CTRL = nil,

---@type 65
SELFD = nil,

---@type 70
SET_WANTED_MAX_SPEED = nil,

---@type 75
LOAD_UNITS = nil,

---@type 76
LOAD_ONTO = nil,

---@type 80
UNLOAD_UNITS = nil,

---@type 81
UNLOAD_UNIT = nil,

---@type 85
ONOFF = nil,

---@type 90
RECLAIM = nil,

---@type 95
CLOAK = nil,

---@type 100
STOCKPILE = nil,

---@type 105
MANUALFIRE = nil,

---@type 105
DGUN = nil,

---@type 110
RESTORE = nil,

---@type 115
REPEAT = nil,

---@type 120
TRAJECTORY = nil,

---@type 125
RESURRECT = nil,

---@type 128
OPT_ALT = nil,

---@type 130
CAPTURE = nil,

---@type 135
AUTOREPAIRLEVEL = nil,

---@type 145
IDLEMODE = nil
}
66 changes: 66 additions & 0 deletions library/LuaConstCMDTYPE.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@

---!!! DO NOT MANUALLY EDIT THIS FILE !!!
---Generated by lua-doc-extractor 0.0.1
---https://github.com/rhys-vdw/lua-doc-extractor
---
---Date: Wed, 20 Nov 2024 13:06:36 GMT
---Source: rts/Lua/LuaConstCMDTYPE.cpp
---
---@meta

---Command type constants
---
---@see rts/Lua/LuaConstCMDTYPE.cpp

---Note, the CMDTYPE[] table is bidirectional. That means: CMDTYPE[CMDTYPE.ICON] := "CMDTYPE_ICON"
---
---@enum CMDTYPE
CMDTYPE = {
---@type number expect 0 parameters in return
ICON = nil,

---@type number expect 1 parameter in return (number selected mode)
ICON_MODE = nil,

---@type number expect 3 parameters in return (mappos)
ICON_MAP = nil,

---@type number expect 4 parameters in return (mappos+radius)
ICON_AREA = nil,

---@type number expect 1 parameters in return (unitid)
ICON_UNIT = nil,

---@type number expect 1 parameters in return (unitid) or 3 parameters in return (mappos)
ICON_UNIT_OR_MAP = nil,

---@type number expect 3 or 6 parameters in return (middle and right side of front if a front was defined)
ICON_FRONT = nil,

---@type number expect 1 parameter in return (number selected option)
COMBO_BOX = nil,

---@type number expect 1 parameter in return (unitid) or 4 parameters in return (mappos+radius)
ICON_UNIT_OR_AREA = nil,

---@type number expect 1 parameter in return (unitid or Game.maxUnits+featureid) or 4 parameters in return (mappos+radius)
ICON_UNIT_FEATURE_OR_AREA = nil,

---@type number expect 3 parameters in return (mappos)
ICON_BUILDING = nil,

---@type number expect 1 parameter in return (unitid) or 3 parameters in return (mappos) or 6 parameters in return (startpos+endpos)
ICON_UNIT_OR_RECTANGLE = nil,

---@type number expect 1 parameter in return (number)
NUMBER = nil,

---@type number used with CMD_INTERNAL
CUSTOM = nil,

---@type number next command page used with CMD_INTERNAL
NEXT = nil,

---@type number previous command page used with CMD_INTERNAL
PREV = nil
}
Loading