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

Locally add align.tokens #664

Closed
ronanM opened this Issue Jan 5, 2017 · 2 comments

Comments

2 participants
@ronanM
Contributor

ronanM commented Jan 5, 2017

This template is a guideline, not a strict requirement.

  • Version: 0.5
  • Integration: IntelliJ
  • Configuration: defaultWithAlign
maxColumn = 100

Original

val l = List(
  (1, "a", 1.0),
  (123, "abc", 123.123),
  (12, "ab", 12.12)
)

Add a special comment to locally add/modify align.tokens list.

Expected

val l = List( // format.align.tokens.add: ","
  (1,   "a",   1.0),
  (123, "abc", 123.123),
  (12,  "ab",  12.12)
)
@olafurpg

This comment has been minimized.

Show comment
Hide comment
@olafurpg

olafurpg Jan 5, 2017

Member

Thank you for reporting! To understand correctly, you would like the alignment to expire at the matching closing parenthesis? If so, I think this would be possible to accommodate using a similar mechanism as auto-binpacking for literal argument lists, see https://github.com/olafurpg/scalafmt/blob/8b426737bca4f3ac754ce6bf1a7966179b3fd33f/core/src/main/scala/org/scalafmt/util/StyleMap.scala#L41-L47

Member

olafurpg commented Jan 5, 2017

Thank you for reporting! To understand correctly, you would like the alignment to expire at the matching closing parenthesis? If so, I think this would be possible to accommodate using a similar mechanism as auto-binpacking for literal argument lists, see https://github.com/olafurpg/scalafmt/blob/8b426737bca4f3ac754ce6bf1a7966179b3fd33f/core/src/main/scala/org/scalafmt/util/StyleMap.scala#L41-L47

@olafurpg

This comment has been minimized.

Show comment
Hide comment
@olafurpg

olafurpg May 12, 2018

Member

Feel free to reopen if someone wants to take a stab at this.

Member

olafurpg commented May 12, 2018

Feel free to reopen if someone wants to take a stab at this.

@olafurpg olafurpg closed this May 12, 2018

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