Templates

FunTemplate & FileTemplates

Scaffold files and functions. Built-in Template folder, or point to a project folder.

Template directory

"luadebug.luaTemplatesDir": "${workspaceFolder}/Template"

Leave empty to use the built-in templates. After editing template files, usually reload the window.

FunTemplate

AutoFunComment.lua

Function comment template. Typing --- above a function applies it. Reload after changes.

CreateFunctionTemplate.lua

Select a function name → right-click “Create function” → enter parameter count and names.

CreateModuleFunctionTemplate.lua

Create a module function; or run the matching LuaDebug command from the Command Palette.

FileTemplates

  1. Add e.g. luaTemplate.lua under FileTemplates with default code.
  2. Reload the window.
  3. Explorer or editor context menu → “Create from template” → pick template → enter file name.

File name vs moduleName

luadebug.inputTemplateModuleName:

Macros

luadebug.macroList declares template macros; placeholders in templates are replaced on create.

Add macro names and values in Settings; placeholder names in templates must match.