Overview
Theformat section controls how the language server formats Lua files. Use a built-in preset, customize individual style rules, or delegate formatting to an external tool like StyLua.
Top-level options
Presets
External formatter
Delegate all formatting to an external tool:.gluarc.json
Style overrides
styleOverrides keys use snake_case matching the EmmyLuaCodeStyle style. They are applied on top of the selected preset.
This page shows common settings. For the complete list, inspect the JSON schema atcrates/glua_code_analysis/resources/schema.jsonunderEmmyrcFormatStyleOverrides.
Basic
Space
Operator space
Alignment
Indent
Line spacing
These keys accept string expressions:"keep", "fixed(n)", "min(n)", "max(n)".
Line break
Preference
VS Code extension settings
GLuaLS does not providegluals.format.* VS Code settings. Configure formatting through .gluarc.json. You can enable format-on-save with these built-in VS Code settings:
Example
.gluarc.json