Page MenuHomePhabricator

[clang-format] Improve support for multiline C# strings
ClosedPublic

Authored by jbcoe on Jan 29 2020, 6:11 AM.

Diff Detail

Event Timeline

jbcoe created this revision.Jan 29 2020, 6:11 AM
jbcoe updated this revision to Diff 241149.Jan 29 2020, 6:54 AM

Fix failing test by bypassing verifyFormat which does not understand C# multiline strings.

This is pretty cool! Just a couple of nits.

clang/lib/Format/FormatTokenLexer.cpp
187–189

nit: please add a comment that some of the string merging is also handled in handleCSharpVerbatimAndInterpolatedStrings.

546

isn't this a no-op?

clang/unittests/Format/FormatTestCSharp.cpp
435

consider adding a test case with a multiline string in the middle of the body of a function with statements after it to verify that the indentation used after the string literal is correct.

krasimir accepted this revision.Jan 29 2020, 7:40 AM
This revision is now accepted and ready to land.Jan 29 2020, 7:40 AM
jbcoe updated this revision to Diff 241184.Jan 29 2020, 9:07 AM

Add additional comment as requested in review.

jbcoe updated this revision to Diff 241400.Jan 30 2020, 3:46 AM

Address review comments - add tests and remove no-op.

jbcoe marked 3 inline comments as done.Jan 30 2020, 3:46 AM
krasimir accepted this revision.Jan 30 2020, 4:45 AM
Closed by commit rGf9f0919db7ea: [clang-format] Improve support for multiline C# strings (authored by Jonathan Coe <jbcoe@google.com>). · Explain WhyJan 30 2020, 5:54 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJan 30 2020, 5:54 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

these are great patches you are making...