Disable merging of Type? into a single token.
Merge ?? ?. and ?[ into a single token.
Paths
| Differential D75368
[clang-format] Handle NullCoalescing and NullConditional operators in C# ClosedPublic Authored by jbcoe on Feb 28 2020, 10:19 AM.
Details Summary Disable merging of Type? into a single token. Merge ?? ?. and ?[ into a single token.
Diff Detail
Event TimelineComment Actions There's a weird test failure I'm unable to reproduce outside of the tests with real source code where public static void Main(string[] args) { string dirPath = args?[0]; } is (mis)-formatted as public static void Main(string[] args) { string dirPath = args?[0]; }
jbcoe retitled this revision from [clang-format] Handle ?. ?? and ?[ as C# tokens to [clang-format] Handle NullCoalescing and NullConditional operators in C#.Mar 2 2020, 5:19 AM krasimir added inline comments. This revision is now accepted and ready to land.Mar 2 2020, 5:26 AM Closed by commit rGc3af063c2bbf: [clang-format] Handle NullCoalescing and NullConditional operators in C# (authored by Jonathan Coe <jbcoe@google.com>). · Explain WhyMar 2 2020, 6:17 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 247618 clang/lib/Format/FormatToken.h
clang/lib/Format/FormatTokenLexer.h
clang/lib/Format/FormatTokenLexer.cpp
clang/lib/Format/TokenAnnotator.cpp
clang/unittests/Format/FormatTestCSharp.cpp
|
nit: consider renaming to CSharpNullConditionalLSquare for consistency with other similar token types.