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

Does not break at higher syntactic level #257

Open
bethcutler opened this issue Nov 16, 2021 · 1 comment
Open

Does not break at higher syntactic level #257

bethcutler opened this issue Nov 16, 2021 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@bethcutler
Copy link
Contributor

When type parameters on a function call cause the line width to be exceeded, ktfmt breaks on the type parameters:

VeryLongNamedServiceMocker.whenever(VeryLongNamedServiceMocker.Method.FunctionName).thenRespond<
    LongType> {
  // do a thing
}

Instead, I would expect the line to be broken at the higher syntactic level, such as

VeryLongNamedServiceMocker.whenever(VeryLongNamedServiceMocker.Method.FunctionName)
  .thenRespond<LongType> {
    // do a thing
  }

or

VeryLongNamedServiceMocker
  .whenever(VeryLongNamedServiceMocker.Method.FunctionName)
  .thenRespond<LongType> {
    // do a thing
  }
@hick209 hick209 added enhancement New feature or request help wanted Extra attention is needed labels Jun 5, 2024
@hick209
Copy link
Contributor

hick209 commented Jun 5, 2024

Currently (v0.49) it formats to this:

VeryLongNamedServiceMocker.whenever(VeryLongNamedServiceMocker.Method.FunctionName).thenRespond<
    LongType> {
  // do a thing
}

Yeah, I agree that we could do better here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants