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

Longer string line not formatted to multiple lines #376

Closed
jitendratheta opened this issue Jun 6, 2019 · 2 comments
Closed

Longer string line not formatted to multiple lines #376

jitendratheta opened this issue Jun 6, 2019 · 2 comments

Comments

@jitendratheta
Copy link

jitendratheta commented Jun 6, 2019

For example:
String foo = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna";

Does not get formatted with line break as

String foo =
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"
+ " incididunt ut labore et dolore magna";

Shouldn't this be a feature given by the library?
This kind of formatting is supported by IDEs for example Idea IntelliJ

@PhilippWendler
Copy link

Related to #122

@cushon
Copy link
Collaborator

cushon commented Jul 29, 2019

The latest version wraps string literals:

google-java-format T.java
class T {
  String foo =
      "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt"
          + " ut labore et dolore magna";
}

@cushon cushon closed this as completed Jul 29, 2019
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

3 participants