Templates

FunTemplate & FileTemplates

Scaffold files and functions. Use the bundled Template folder or point to one in the project.

Template directory

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

Leave empty to use bundled templates. After editing template files, reload the window so they take effect.

FunTemplate

AutoFunComment.lua

Function comment template. Typing --- above a function applies it. Reload the window after edits.

CreateFunctionTemplate.lua

Select a function name → right-click Create Function → enter arity and parameter names.

CreateModuleFunctionTemplate.lua

Create a module function; you can also run the matching LuaDebug command from the command palette.

FileTemplates

  1. Add e.g. luaTemplate.lua under FileTemplates with the default body.
  2. Reload the window.
  3. Right-click in Explorer or the editor → Create template file → pick a template → enter a file name.

File name & moduleName

luadebug.inputTemplateModuleName:

Macro variables

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

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