Thanks to visit codestin.com
Credit goes to github.com

Skip to content

multiline string line span #828

@lue-bird

Description

@lue-bird

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions