Skip to content

TOC File Support ​

wowlua-ls provides full language server features for WoW .toc files: syntax highlighting, hover documentation, completions, go-to-definition, and diagnostics.

What it does ​

Every WoW addon has a .toc file that declares metadata (title, dependencies, saved variables) and lists the Lua/XML files to load. Editing these files without tooling means memorizing field names, manually checking file paths, and catching typos only at runtime.

With TOC support enabled, you get:

  • Syntax highlighting: Header keys, values, comments, directives, and file paths are colorized
  • Hover documentation: Hover any standard field name to see what it does, or hover an Interface version to see which expansion it maps to
  • Completions: Type ## and get suggestions for all standard fields; type a value and get context-aware options (game types, boolean values, file paths)
  • Go-to-definition: Click a file path to jump directly to that .lua or .xml file
  • Diagnostics: Catch common mistakes before you reload your addon

Example ​

## Interface: 110100
## Title: My Addon
## Notes: Does useful things
## SavedVariables: MyAddonDB
## Dependencies: Ace3
## AllowLoadGameType: mainline, cata
## IconTexture: Interface\Icons\INV_Misc_QuestionMark
## LoadOnDemand: 1

# Core files
Core/Init.lua
Core/Config.lua

# UI
UI/MainFrame.xml
UI/MainFrame.lua

Hovering Interface shows its documentation. Hovering 110100 shows "The War Within 11.1.0". Hovering mainline shows "Retail and Forever".

Completions after ## suggest Title, Notes, Author, SavedVariables, etc., filtered to exclude fields you've already declared.

Supported fields ​

wowlua-ls recognizes all standard TOC fields:

FieldDescription
InterfaceWoW client interface version (required)
TitleAddon display name in the addon list
NotesShort description tooltip
AuthorAddon author(s)
VersionVersion string
SavedVariablesAccount-wide persisted globals
SavedVariablesPerCharacterPer-character persisted globals
DependenciesRequired addon dependencies (alias: RequiredDeps)
OptionalDepsOptional load-order dependencies
LoadOnDemandLoad only when explicitly requested (1/0)
DefaultStateWhether enabled by default (enabled/disabled)
LoadWithLoad this addon when any listed addon loads
LoadManagersAddons that manage loading this addon
IconTexture, IconAtlasAddon compartment icon (texture path or atlas name)
AddonCompartmentFuncCompartment click handler
AddonCompartmentFuncOnEnterCompartment hover-enter handler
AddonCompartmentFuncOnLeaveCompartment hover-leave handler
AllowLoadGameTypeRestrict to specific game flavors: mainline, standard, classic, vanilla, cata, wrath, tbc, mists, camelot (or forever), plunderstorm, wowhack
ExcludeLoadGameTypeLoad on every game flavor except the ones listed (the inverse of AllowLoadGameType)
OnlyBetaAndPTRRestrict to test realms only
SecureBlizzard-signed secure code marker
CategoryCategory the addon is listed under in the addon list
GroupGroups related addons under a shared collapsible header in the addon list
LoadSavedVariablesFirstLoad saved variables before the addon's files run (1/0)

Additionally:

  • X-* fields: Custom addon metadata (e.g. X-Website, X-Curse-Project-ID) are recognized and won't trigger unknown-field warnings
  • Locale suffixes: Title, Notes, Category, and Group accept locale suffixes (e.g. Title-deDE, Group-enUS) and are recognized as localized variants
  • Flavor-specific interface versions: Interface-Classic, Interface-Cata, and other Interface-<Type> lines that addon packagers use to build per-flavor TOC files are recognized and validated like Interface; their versions count toward the addon's flavors

Per-line directives ​

TOC files support two kinds of bracketed tokens on file lines: load conditions that restrict when a file loads, and path variables that expand inline within the path. Conditions may appear before, after, or between path segments - the WoW client's documented form places them after the path:

Retail/FrameOverrides.lua [AllowLoadGameType mainline]
Classic/Compatibility.lua [AllowLoadGameType classic]
TableBuilder.lua [ExcludeLoadGameType vanilla tbc wrath]
Localized.lua [AllowLoadGameType mainline] [AllowLoadTextLocale enUS]
[Family]Shared/Utils.lua
Locale/[TextLocale].lua

The prefix form ([AllowLoadGameType mainline] File.lua) is also accepted.

BracketKindDescription
[AllowLoadGameType ...]ConditionOnly load this file on specified game flavors (mainline, standard, classic, vanilla, cata, wrath, tbc, mists, camelot (or forever), plunderstorm, wowhack)
[ExcludeLoadGameType ...]ConditionLoad this file on every game flavor except the listed ones
[AllowLoadTextLocale ...]ConditionOnly load on specified client locales (e.g. enUS, frFR)
[AllowLoad ...]ConditionRestrict to an environment (ingame / glue)
[Family]Path variableExpands to the game family subdirectory (Mainline / Classic)
[Game]Path variableExpands to the specific game subdirectory
[TextLocale]Path variableExpands to the client text locale (e.g. enUS)

Game-type values may be separated by commas or plain whitespace — both forms appear in Blizzard's own TOC files. An [ExcludeLoadGameType ...] removes a flavor once every game type in it is listed, so [ExcludeLoadGameType vanilla tbc wrath] still counts as loading on Cataclysm and Mists.

Only the game-type conditions affect flavor filtering; the other conditions are recognized and stripped but don't change a file's flavor. Hover a bracket to see its documentation.

Diagnostics ​

TOC files have their own set of diagnostics:

CodeSeverityDescription
toc-missing-interfaceWarningRequired ## Interface: field is missing
toc-duplicate-headerWarningSame header key appears more than once
toc-unknown-headerHintHeader not in the known catalog and not an X-* custom field
toc-invalid-interfaceErrorInterface value is not a valid numeric version
toc-nonexistent-fileWarningReferenced file does not exist on disk
toc-invalid-valueWarningUnknown game type in AllowLoadGameType / ExcludeLoadGameType (header or per-line), or a header missing its colon

Go-to-definition ​

Click any file path in a TOC file to navigate directly to that file. This works for both .lua and .xml references. Paths are resolved relative to the TOC file's directory.

Paths that use the [Family], [Game], or [TextLocale] path variables can't be followed, since what they expand to depends on the client loading the addon. They're also skipped by toc-nonexistent-file.

No configuration needed ​

TOC support is enabled automatically when you open a .toc file. No .wowluarc.json settings are required. The language server activates on .toc files the same way it does for .lua files.