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

Bug: error when too long line before ending triple quotes #969

Open
benediktsatalia opened this issue Sep 13, 2023 · 1 comment
Open

Bug: error when too long line before ending triple quotes #969

benediktsatalia opened this issue Sep 13, 2023 · 1 comment

Comments

@benediktsatalia
Copy link

I have a very simple example where google-java-format errors:

class Problem {
  static String problematic() {
    return """
A too long string directly before the ending triple quote seems to cause a problem with google java formatter""";
  }
}

When I run the formatter on this file (using java -jar /path/to/google-java-format-1.17.0-all-deps.jar /path/to/Problem.java) I get the following error:

/path/to/Problem.java:error: Something has gone terribly wrong. We planned to make the below formatting change, but have aborted because it would unexpectedly change the AST.
Please file a bug: https://github.com/google/google-java-format/issues/new

=== Actual: ===

class Problem {
    
    static String problematic() {
        return "A too long string directly before the ending triple quote seems to cause a problem\"\n               + \" with google java formatter";
    }
}
=== Expected: ===

class Problem {
    
    static String problematic() {
        return "A too long string directly before the ending triple quote seems to cause a problem with google java formatter";
    }
}

@benediktsatalia benediktsatalia changed the title Bug: error when too long line before triple quotes Bug: error when too long line before ending triple quotes Sep 13, 2023
@forszpanen
Copy link

forszpanen commented Nov 2, 2023

Do you have any workaround?
#980

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

2 participants