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

Breaking of import lines #101

Closed
sjrd opened this Issue Mar 9, 2016 · 7 comments

Comments

Projects
None yet
4 participants
@sjrd

sjrd commented Mar 9, 2016

Original:

import scala.language.implicitConversions

import org.scalajs.dom.experimental.serviceworkers.{ServiceWorkerGlobalScope, ServiceWorkerRegistration}

import scala.scalajs.js

Scalafmt:

import scala.language.implicitConversions

import org.scalajs.dom.experimental.serviceworkers.{ServiceWorkerGlobalScope,
ServiceWorkerRegistration}

import scala.scalajs.js

I would like the input to look like this:

import scala.language.implicitConversions

import org.scalajs.dom.experimental.serviceworkers.{ServiceWorkerGlobalScope, ServiceWorkerRegistration}

import scala.scalajs.js

or

import scala.language.implicitConversions

import org.scalajs.dom.experimental.serviceworkers.{
  ServiceWorkerGlobalScope, ServiceWorkerRegistration
}

import scala.scalajs.js

Using

  • 0.1.1
  • default
@olafurpg

This comment has been minimized.

Show comment
Hide comment
@olafurpg

olafurpg Mar 9, 2016

Member

I have a temporary fix that will keep each import statement on a single line. Produces this:

import org.scalajs.dom.experimental.serviceworkers.{ServiceWorkerGlobalScope, ServiceWorkerRegistration}

Am I free to close this issue? IMO, if your import statement is this long you should not wrap them in {}. I'm sure some people will disagree, and if they're motivated they can open an issue.

Member

olafurpg commented Mar 9, 2016

I have a temporary fix that will keep each import statement on a single line. Produces this:

import org.scalajs.dom.experimental.serviceworkers.{ServiceWorkerGlobalScope, ServiceWorkerRegistration}

Am I free to close this issue? IMO, if your import statement is this long you should not wrap them in {}. I'm sure some people will disagree, and if they're motivated they can open an issue.

@olafurpg olafurpg added the in progress label Mar 9, 2016

@sjrd

This comment has been minimized.

Show comment
Hide comment
@sjrd

sjrd Mar 9, 2016

Fine by me.

sjrd commented Mar 9, 2016

Fine by me.

@olafurpg olafurpg closed this in a2a9ee8 Mar 10, 2016

@olafurpg olafurpg removed the in progress label Mar 10, 2016

@regadas

This comment has been minimized.

Show comment
Hide comment
@regadas

regadas Jun 12, 2016

what about the following? sometimes imports can be pretty long.

import scala.language.implicitConversions

import org.scalajs.dom.experimental.serviceworkers.{
  ServiceWorkerGlobalScope,
  ServiceWorkerRegistration
}

import scala.scalajs.js

regadas commented Jun 12, 2016

what about the following? sometimes imports can be pretty long.

import scala.language.implicitConversions

import org.scalajs.dom.experimental.serviceworkers.{
  ServiceWorkerGlobalScope,
  ServiceWorkerRegistration
}

import scala.scalajs.js
@olafurpg

This comment has been minimized.

Show comment
Hide comment
@olafurpg

olafurpg Jun 12, 2016

Member

I agree that is a nice fallback layout if the imports don't fit on one line. Adding this should not be a big hassle. I'll reopen this issue, although I can't promise when I'll have time to get to it.

Member

olafurpg commented Jun 12, 2016

I agree that is a nice fallback layout if the imports don't fit on one line. Adding this should not be a big hassle. I'll reopen this issue, although I can't promise when I'll have time to get to it.

@olafurpg olafurpg reopened this Jun 12, 2016

@pascoej

This comment has been minimized.

Show comment
Hide comment
@pascoej

pascoej Jul 8, 2016

@regadas 's syntax is the holy grail.

pascoej commented Jul 8, 2016

@regadas 's syntax is the holy grail.

@olafurpg olafurpg added this to the 0.2.13 milestone Aug 6, 2016

@olafurpg

This comment has been minimized.

Show comment
Hide comment
@olafurpg

olafurpg Aug 6, 2016

Member

Closed by 5a40e14 and enabled in the default style. The Scala.js style keeps the old behavior where the import stays on a single line.

Member

olafurpg commented Aug 6, 2016

Closed by 5a40e14 and enabled in the default style. The Scala.js style keeps the old behavior where the import stays on a single line.

@olafurpg olafurpg closed this Aug 6, 2016

@regadas

This comment has been minimized.

Show comment
Hide comment

regadas commented Aug 6, 2016

@olafurpg nice! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment