Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve formatting for table literals with long table types #881

Open
znotfireman opened this issue Aug 1, 2024 · 0 comments
Open

Improve formatting for table literals with long table types #881

znotfireman opened this issue Aug 1, 2024 · 0 comments
Labels
enhancement New feature or request luau Formatting related to Luau

Comments

@znotfireman
Copy link

Expected Stylua to format the following as such:

local thisWorksOnlyWith: {
  {
    longNamesAnd: any,
    itShouldNotPutThe: any,
    curlyBracketsOnAnotherLine: any,
  }
} = {}

Actually formats as below with curly braces on another line:

local thisWorksOnlyWith: {
  {
    longNamesAnd: any,
    itShouldNotPutThe: any,
    curlyBracketsOnAnotherLine: any,
  }
} =
  {}
  • Seems to only work with long lines
  • Indexers also cause this e.g. [any]: { ... } will cause this
@JohnnyMorganz JohnnyMorganz added the enhancement New feature or request label Aug 10, 2024
@JohnnyMorganz JohnnyMorganz added the luau Formatting related to Luau label Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request luau Formatting related to Luau
Projects
None yet
Development

No branches or pull requests

2 participants