Skip to content
Ketho edited this page Aug 27, 2024 · 16 revisions

Frequently Asked Questions

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.

Workspace detection

To avoid loading for Lua projects not related to World of Warcraft, there are a couple of measures in place.

This extension will only activate when either:

  • the extension was previously loaded in the workspace.
    • a settings.json with Lua.workspace.library containing a path with the substring wow-api exists in the workspace on startup.
  • a .toc file exists.
    • a .toc file with the ## Interface: directive exists in the workspace on startup.
  • the "Activate WoW API extension" command is used.
Clone this wiki locally