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

`::` is not correctly indented #798

Closed
pjrt opened this Issue Mar 7, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@pjrt
Collaborator

pjrt commented Mar 7, 2017

Steps

The following test fails:

<<< Indent `::` with tuples
val overrides =
      "akka.log-config-on-start" -> "on" ::
      "akka.cluster.split-brain-resolver.static-quorum.quorum-size" -> 1 ::
        "akka.remote.netty.tcp.hostname" -> akkaHost ::
        "akka.remote.netty.tcp.port" -> akkaPort ::
        Nil
>>>
  val overrides =
    "akka.log-config-on-start" -> "on" ::
      "akka.cluster.split-brain-resolver.static-quorum.quorum-size" -> 1 ::
      "akka.remote.netty.tcp.hostname" -> akkaHost ::
      "akka.remote.netty.tcp.port" -> akkaPort ::
      Nil
@olafurpg

This comment has been minimized.

Show comment
Hide comment
@olafurpg

olafurpg Mar 7, 2017

Member

This doesn't seem to be even related to the arrows

  val overrides =
    "akka.log-config-on-start" ::
      "akka.cluster.split-brain-resolver.static-quorum.quorum-size" ::
    "akka.remote.netty.tcp.hostname" ::
    "akka.remote.netty.tcp.port" ::
    Nil
Member

olafurpg commented Mar 7, 2017

This doesn't seem to be even related to the arrows

  val overrides =
    "akka.log-config-on-start" ::
      "akka.cluster.split-brain-resolver.static-quorum.quorum-size" ::
    "akka.remote.netty.tcp.hostname" ::
    "akka.remote.netty.tcp.port" ::
    Nil

@olafurpg olafurpg added the bug label Mar 7, 2017

@pjrt

This comment has been minimized.

Show comment
Hide comment
@pjrt

pjrt Mar 7, 2017

Collaborator

Oh, interesting, I assumed that was the case since the previous test in ApplyInfix already uses plain strings.

I've reduced it to this and I still get it:

<<< ONLY With tuples
val overrides =
      "logconfigonstart" ::
      "quorumsize" ::
        "hostname" ::
        "port" ::
        Nil

>>>
  val overrides =
    "logconfigonstart" ::
      "quorumsize" ::
      "hostname" ::
      "port" ::
      Nil

(I thought maybe it was the . and the - but nope. Plain strings.

Collaborator

pjrt commented Mar 7, 2017

Oh, interesting, I assumed that was the case since the previous test in ApplyInfix already uses plain strings.

I've reduced it to this and I still get it:

<<< ONLY With tuples
val overrides =
      "logconfigonstart" ::
      "quorumsize" ::
        "hostname" ::
        "port" ::
        Nil

>>>
  val overrides =
    "logconfigonstart" ::
      "quorumsize" ::
      "hostname" ::
      "port" ::
      Nil

(I thought maybe it was the . and the - but nope. Plain strings.

@pjrt pjrt changed the title from `::` is not correctly indented if the values are tuples with `->` to `::` is not correctly indented Mar 7, 2017

olafurpg added a commit that referenced this issue Mar 7, 2017

Fix #798.
infixSplit is used for both infix applications, where we want to handle
infix operators, and also for assignment, where we don't want to handle
right associative operators.

This commit is a poor fix/hack/workaround for this issue. I would love
to come with a better design/implementation to avoid this duct taping,
but I'm afraid I don't have so much time right now and I want to publish
a fix quickly.

@olafurpg olafurpg closed this in 3e8ccfb Mar 7, 2017

pjrt added a commit to pjrt/scalafmt that referenced this issue Mar 9, 2017

Fix #798. (#803)
infixSplit is used for both infix applications, where we want to handle
infix operators, and also for assignment, where we don't want to handle
right associative operators.

This commit is a poor fix/hack/workaround for this issue. I would love
to come with a better design/implementation to avoid this duct taping,
but I'm afraid I don't have so much time right now and I want to publish
a fix quickly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment