[2.2.0] - 2025-09-14
Added
- Added option
block_newline_gaps
to determine whether newline gaps at the start / end of blocks should be preserved. Defaults toNever
, which is the original behaviour. (#857) - StyLua can now run in a language server mode. Start StyLua with
stylua --lsp
and connect with a language client. (#936)
Changed
- Luau: Improved union of tables formatting to hang the union type rather than attempt to hug all the tables together (#958)
Fixed
- Fixed formatting of index containing brackets string in parentheses (#992)
- Fixed goto not being recognised for LuaJIT (#986)
- Fixed semicolon removed after a statement ending with an if-expression leading to ambiguous syntax when the next line begins with parentheses (#1010)
- Luau: Fixed malformed formatting when there is a comment after a type specifier in a local assignment (#995)
- Luau: Fixed long type union formatted onto a single line if there is a comment in between the equals sign and the type union in a type declaration (#1007)
- Fixed StyLua installation via pip / uv for Windows (#1018)
External Contributions
- Fix formatting of index containing brackets string in parentheses by @phanen in #992
- Fix goto not being recognised for LuaJIT by @Sainan in #998
- Add option to preserve newline gaps for blocks by @InoUno in #857
- feat: Stylua LSP server by @PolyMeilex in #970
- fix(release-gitter): correct Windows asset name for pip build by @izzalDev in #1018
New Contributors
- @Sainan made their first contribution in #998
- @InoUno made their first contribution in #857
- @PolyMeilex made their first contribution in #970
- @izzalDev made their first contribution in #1018
Full Changelog: v2.1.0...v2.2.0