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

alignStripMarginStrings should respect pipe char on first line #324

Closed
hseeberger opened this Issue Jun 20, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@hseeberger

hseeberger commented Jun 20, 2016

Original:

"""|first
   |second""".stripMargin

Scalafmt:

"""|first
  |second""".stripMargin

I would like the input to look like this:

"""|first
   |second""".stripMargin

Using:

  • 0.2.5
  • --alignStripMarginStrings true

If the first character on the first line is a pipe character (strip margin character), the pipe characters on the following lines should be indented such that they are aligned with the pipe character on the fist line and not with the last double quote.

@olafurpg

This comment has been minimized.

Show comment
Hide comment
@olafurpg

olafurpg Jun 20, 2016

Member

Huh, I've never seen the pipe used like that, but I kind of like it. This should be possible to accommodate in 0.2.7

Member

olafurpg commented Jun 20, 2016

Huh, I've never seen the pipe used like that, but I kind of like it. This should be possible to accommodate in 0.2.7

@olafurpg olafurpg added this to the 0.2.7 milestone Jun 20, 2016

@hseeberger

This comment has been minimized.

Show comment
Hide comment
@hseeberger

hseeberger Jun 20, 2016

Great! Using the pipe like that – which I have seen in several places – can help with readability a lot in specific situations. Looking forward to 0.2.7 ;-)

Great! Using the pipe like that – which I have seen in several places – can help with readability a lot in specific situations. Looking forward to 0.2.7 ;-)

@olafurpg olafurpg closed this in 35b6471 Aug 6, 2016

@olafurpg

This comment has been minimized.

Show comment
Hide comment
@olafurpg

olafurpg Aug 6, 2016

Member

Finally got around to this issue :) If the first characters is a pipe the indentation increases by one space. It was tricker than I expected since I had to account for interpolated strings, which have a completely different structure compared to string literals. Let me know if you find any issues with this new feature.

PS. hoping to get a release out today/tomorrow.

Member

olafurpg commented Aug 6, 2016

Finally got around to this issue :) If the first characters is a pipe the indentation increases by one space. It was tricker than I expected since I had to account for interpolated strings, which have a completely different structure compared to string literals. Let me know if you find any issues with this new feature.

PS. hoping to get a release out today/tomorrow.

@hseeberger

This comment has been minimized.

Show comment
Hide comment
@hseeberger

hseeberger Aug 7, 2016

Great stuff!

Great stuff!

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