Skip to content

Releases: JohnnyMorganz/StyLua

v0.12.5

08 Mar 21:20
Compare
Choose a tag to compare

This release only affects users of the luau feature flag

[0.12.5] - 2022-03-08

Fixed

Luau

  • Fixed crashed due to unhandled generic type packs under the luau feature flag. (#403)

Full Changelog: v0.12.4...v0.12.5

v0.12.4

02 Mar 22:08
Compare
Choose a tag to compare

[0.12.4] - 2022-03-02

Fixed

General

  • Fixed comments being lost around a condition when unnecessary parentheses are removed. (#389)
  • Fixed multiline expression with comments inside parentheses being collapsed leading to a syntax error. (#386)
  • Fixed ignore comments not respected in child blocks of ignored statements. (#387)

Luau

  • Fixed long comments forcing unnecessary hanging of type declarations. (#384)
  • Fixed long intersection types not hanging. (#382)
  • Fixed values in type tables not hanging when over width. (#394)
  • Fixed type info generics not hanging when over width. (#394)
  • Fixed callback types with binop type parameters / return types not hanging leading to a syntax error when comments are present. (#396)
  • Fixed type declarations not hanging properly causing them to go over width. This includes hanging at the equals token and hanging union/intersection types.

v0.12.3

17 Feb 23:41
Compare
Choose a tag to compare

[0.12.3] - 2022-02-17

Fixed

General

  • Fixed call chains not hanging when comments were present in between calls, leading to a syntax error. (#367)

Luau

  • Fixed if-expression syntax getting unnecessarily expanded further due to trailing comments. (#375)
  • Fixed formatting of leading comments of a keyword in if-expression syntax. (#374)
  • Fixed formatting of long type declarations which go over the line width to hang if possible. (#372)
  • Fixed mistransformation of comments within a type union leading to a syntax error. (#378)

What's Changed

Full Changelog: v0.12.2...v0.12.3

v0.12.2

06 Feb 20:19
Compare
Choose a tag to compare

This release only affects users of the luau feature flag.

Fixed

  • Fixed crash due to unhandled singleton type formatting under the luau feature flag. (#358)
  • Includes types in shape calculation for causing a generic for to go multiline under the luau feature flag. (#360)

What's Changed

Full Changelog: v0.12.1...v0.12.2

v0.12.1

01 Feb 21:34
Compare
Choose a tag to compare

[0.12.1] - 2022-02-01

Fixed

  • Fixed misformatting of conditions in if-expression syntax leading to spurious whitespace under the luau feature flag. (#349)
  • Fixed incorrect shape calculation in if-expression syntax: if-expression will now go multiline when only slightly over column width (luau feature flag).
  • Fixed incorrect handling of comments at the end of a callback type's arguments under the luau feature flag. (#352)
  • Fixed mistransformation of type declaration when the type info is a union which must be multiline due to comments under the luau feature flag. (#351)
  • Fixed leading comments on a | symbol in a type info being lost when hanging the type under the luau feature flag.
  • Fixed trailing comments of a function call being lost as parentheses are removed around a single argument when call_parentheses is set to not Always. (#356)

What's Changed

Full Changelog: v0.12.0...v0.12.1

v0.12.0

31 Jan 00:14
Compare
Choose a tag to compare

[0.12.0] - 2022-01-31

Added

  • Added option call_parentheses:
    Specify whether to apply parentheses on function calls with single string or table arg. Possible options: Always (default), NoSingleString, NoSingleTable, None. (#329)
  • Added proper multiline hanging of generic for syntax. (#322)
  • Added proper formatting for if-expression syntax under the luau feature flag. (#289)
  • Updated parser to add support for generic/variadic type packs, singleton types and default types under the luau feature flag.

Fixed

  • Fixed generic variadics not being handled under the luau feature flag. (#333)
  • Fixed issue with comments within an assignment not being correctly handled, leading to a syntax error. (#340)
  • Fixed parentheses around an IfExpression being removed, leading to incorrect semantics, under the luau feature flag. (#345)

Deprecated

  • Option no_call_parentheses has been deprecated. Use call_parentheses = "None" instead.

What's Changed

New Contributors

Full Changelog: v0.11.3...v0.12.0

v0.11.3

01 Jan 22:25
Compare
Choose a tag to compare

[0.11.3] - 2022-01-01

Fixed

  • Fixed comments preceding a comma within a function call or parameter list for a function definition being mistransformed leading to a syntax error. (#307)
  • Fixed IfExpression having abnormal leading whitespace under the luau feature flag. (#315)
  • Fixed incorrect handling of comments in unusual places within a table causing mistransformations leading to syntax errors. (#318)

What's Changed

New Contributors

Full Changelog: v0.11.2...v0.11.3

v0.11.2

15 Nov 12:05
Compare
Choose a tag to compare

[0.11.2] - 2021-11-15

Fixed

  • Fixed spaces around brackets string ([[string]]) used as an index or table key (i.e. [ [[string]] ]) being removed, leading to a syntax error. (#293)
  • Fixed incorrect shape calculation leading to arguments incorrectly expanding when under column width. (#298)
  • Fixed incorrect shape calculation for singleline table at the column width boundary. (#296)
  • Fixed IfExpression syntax containing extra/abnormal trailing whitespace when currently formatting as-is under the luau feature flag. (#297)
  • Fixed newlines before arguments in a function call which is later formatted on a single line being preserved, leading to inconsistent formatting. (#290)
  • Fixed odd formatting when returning multiple tables or functions only. (#302)
  • Fixed comments within an index expression (foo[index]) incorrectly handled leading to malformed formatting. (#304)

v0.11.1

08 Nov 14:35
Compare
Choose a tag to compare

[0.11.1] - 2021-11-08

Changed

  • Updated internal parser to fix parsing issues and update luau parsing. (#229, #231)
  • Default glob now matches **/*.luau (as well as **/*.lua) when the luau flag is enabled. (#291)

Fixed

  • Fixed indentation of type callback specifier parameters when parameters have leading comment trivia. (#278)
  • Fixed trailing comma not being taken into account when determining the width of a field in a multiline table. (#282)
  • Fixed --num-threads 1 causing a deadlock. (#281)
  • Fixed whitespace around parts of a binary expression causing it to over-hang in first pass, leading to unstable formatting. (#287)

v0.11.0

16 Sep 20:24
Compare
Choose a tag to compare

[0.11.0] - 2021-09-16

Changed

  • In Luau type tables, a newline after the opening brace will now force the type table multiline. This is the same procedure as standard tables. (#226)
  • In Luau, type specifiers for function parameters will now force the parameters to be formatted multiline if a specifier is multiline (and there is more than one parameter).
  • Improved error messages to make them easier to understand.

Fixed

  • Fixed range formatting no longer working when setting the range to statements inside nested blocks. (#239)
  • Fixed ignore file present in cwd not taken into account if cwd not included in file paths to format. (#249)
  • Fixed config locations ($XDG_CONFIG_HOME and $HOME/.config) not being looked into correctly on macOS when --search-parent-directories is used. (#260)
  • Fixed incorrect indentation of multiline type specifiers for function parameters under the luau feature flag. (#256)
  • Fixed unstable formatting caused by a singleline table which just reaches the column width. (#261)
  • Fixed misformatting of a binop expression as precedence of the RHS expression was not taken into account. (#257, #261)