Skip to content
Ketho edited this page Apr 12, 2025 · 21 revisions

AddOn namespace

The AddOn namespace needs to be annotated with @class in each file. This way the language server knows about the shared table and also allows you to mutate it.

  • file1.lua
---@class ns
local ns = select(2, ...)

ns.foo = "hello"
  • file2.lua
---@class ns
local ns = select(2, ...)

ns.bar = "world"

The class name (e.g. ns) does not need to be unique unless there are multiple addons in your workspace.

Deprecated API

If you intend to use deprecated APIs for Classic, the warning and strikethrough can be removed by disabling its diagnostic.

Classic support

There is currently no targeted support for Classic Era and Cataclysm Classic. But the hover tooltip will show the flavors a function exists in.

Contributing

The extension reflects the state of the wiki, so if you create/update the wiki pages, it will be updated in the extension on the next release. Only functions on https://warcraft.wiki.gg/wiki/World_of_Warcraft_API which are not documented in Blizzard_APIDocumentationGenerated will be synchronized.

For example UnitLevel would be documented like so.

{{wowapi}}
Returns the level of the unit.
 level = UnitLevel(unit)

==Arguments==
:;unit:{{apitype|UnitToken}}

==Returns==
:;level:{{apitype|number}}

Alternatively, the script will look for a commented block in the wikitext of the API pages.

<!-- luals
---@param unit UnitToken
---@return number level
function UnitLevel(unit) end
-->

Developing

Acknowledgements

Clone this wiki locally