supports things like:
- Lua 5.1, 5.4
- Luau types and generics
- Labels and
goto
- Compound assignment
- String interpolation
- Backtick strings
- Tables and functions
it keeps names and library APIs as they are
example
local function greet(name)
print("hi " .. name);
end
local message = `Hello {name}!`;
greet("world");
Commands
- Format Document -
shift + alt + f (literally default vscode format)
- Lua Formatter: Format Document
- Lua Formatter: Configure — pick a setting
- Lua Formatter: Semicolons —
true or false
- Lua Formatter: Quote Style
- Lua Formatter: Trailing Commas
- Lua Formatter: Final Newline
- Lua Formatter: Indent Size
- Lua Formatter: Use Tabs
- Lua Formatter: Open Settings
open a .lua or .luau file and format the document!
Settings
| Setting |
Default |
luaFormatter.semicolons |
true |
luaFormatter.indentSize |
2 |
luaFormatter.useTabs |
editor setting |
luaFormatter.lineWidth |
100 |
luaFormatter.quoteStyle |
preserve |
luaFormatter.trailingComma |
multiline |
luaFormatter.insertFinalNewline |
true |
License
MIT. check out: LICENSE.
| |