Skip to content

Java text blocks aren't understood by clang-format #61954

Closed
@sh-at-cs

Description

@sh-at-cs

Since Java 15, the language has support for multi-line text blocks, e.g.:

String myStr = """
hello
there
""";

These aren't understood by clang-format at all, e.g. it would format the snippet above as

String myStr = "" "
    hello there "" ";

which is nonsense and doesn't even compile.

Tested on clang-format version 16.0.0.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions