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

Adjust indentation of multiline string #593

Closed
jmattheis opened this issue Jul 31, 2023 · 0 comments · Fixed by #596
Closed

Adjust indentation of multiline string #593

jmattheis opened this issue Jul 31, 2023 · 0 comments · Fixed by #596

Comments

@jmattheis
Copy link

Prettier-Java 2.2.0

Input:

class Main {

  public static void main(String[] args) {
      System.out.println("""
              abaoeu
              euaoeu
              aoeu
              aoeu
              aoeu
              oaeu
              oaeu
              """);
  }
}

Output:

class Main {

  public static void main(String[] args) {
    System.out.println(
      """
              abaoeu
              euaoeu
              aoeu
              aoeu
              aoeu
              oaeu
              oaeu
              """
    );
  }
}

The start (""") of the multiline string will be moved, but the rest stays the same, it would more readable, if prettier could remove some indentation like:

Expected behavior:

class Main {

  public static void main(String[] args) {
    System.out.println(
      """
      abaoeu
      euaoeu
      aoeu
      aoeu
      aoeu
      oaeu
      oaeu
      """
    );
  }
}

Feel free to close this issue, if it's not something you want to support.

jtkiesel added a commit to jtkiesel/prettier-java that referenced this issue Aug 6, 2023
jtkiesel added a commit to jtkiesel/prettier-java that referenced this issue Aug 12, 2023
clementdessoude pushed a commit that referenced this issue Aug 15, 2023
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

Successfully merging a pull request may close this issue.

1 participant