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

multiline string line span #828

Open
lue-bird opened this issue Dec 29, 2024 · 0 comments
Open

multiline string line span #828

lue-bird opened this issue Dec 29, 2024 · 0 comments

Comments

@lue-bird
Copy link

lue-bird commented Dec 29, 2024

Formatting code like below doesn't change it:

a =
    String.reverse ("""first line
              second line""" ++ ".")
  • the call's first argument isn't moved to the next line
  • the operator ++ does not get its own line
  • the closing paren isn't moved to the next line

A simple solution would be checking whether the range of the multiline string starts and ends on the same line
and considering it multi vs single-line based on that.

I assume the current behavior is to some part intentional because it enables a kind of string interpolation syntax.
If yes, I think making an exception for multi-line strings with just ++ seems okay, while still considering the whole ++ chain as multi-line.

Thanks <3

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

No branches or pull requests

1 participant