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

Wrong indent for class delegate in companion object #963

Closed
vRallev opened this issue Nov 17, 2020 · 0 comments · Fixed by #961
Closed

Wrong indent for class delegate in companion object #963

vRallev opened this issue Nov 17, 2020 · 0 comments · Fixed by #961

Comments

@vRallev
Copy link

vRallev commented Nov 17, 2020

If this is a duplicate of #960, then please close this issue.

Expected Behavior

This is how Android Studio formats the code. We use 2 space indent, but the result is the same for 4 space indent.

  companion object : V2LayoutBinding<Abc> by bindLayout1(
    Abc::class,
    R.layout.abc,
    runnerConstructor = ::Abc
  )

Observed Behavior

KtLint formats the code like that:

  companion object : V2LayoutBinding<SerumDemoLoaderScreen> by bindLayout1(
      SerumDemoLoaderScreen::class,
      R.layout.serum_demo_loader,
      runnerConstructor = ::SerumDemoLoaderLayoutRunner
    )

Your Environment

  • Version of ktlint used: Latest snapshot from master 0.40.0
t-kameyama added a commit to t-kameyama/ktlint that referenced this issue Nov 17, 2020
romtsn pushed a commit that referenced this issue Nov 18, 2020
* IndentationRule: fix wrong indentation in delegation

* Add a test for #963
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant