Skip to content
Ketho edited this page Aug 8, 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 does not need to be unique unless there are multiple addons in your workspace, but it would still be a good practice.

Deprecated API

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

Clone this wiki locally