Revert "[clang-format] Correct indentation for `[key] = value,` entries in C++ object...
authorJonathan Coe <jbcoe@google.com>
Tue, 10 Mar 2020 09:30:34 +0000 (09:30 +0000)
committerJonathan Coe <jbcoe@google.com>
Tue, 10 Mar 2020 09:30:34 +0000 (09:30 +0000)
Commit message says "C++" where it should say "C#".

This reverts commit cb3f20d27c9e91cb9f997f0401f388e62c4ba993.

clang/lib/Format/ContinuationIndenter.cpp
clang/unittests/Format/FormatTestCSharp.cpp

index 9a6d787..a08f5a3 100644 (file)
@@ -1047,9 +1047,6 @@ unsigned ContinuationIndenter::getNewLineColumn(const LineState &State) {
   if (NextNonComment->is(TT_ArraySubscriptLSquare)) {
     if (State.Stack.back().StartOfArraySubscripts != 0)
       return State.Stack.back().StartOfArraySubscripts;
-    else if (Style.isCSharp()) // C# allows `["key"] = value` inside object
-                               // initializers.
-      return State.Stack.back().Indent;
     return ContinuationIndent;
   }
 
index 7f819a6..a22f486 100644 (file)
@@ -551,15 +551,6 @@ private Transformer _transformer = new X.Y {
   Scaler = (Shape shape) => { return new Transform.Resize(shape, 0.1); },
 };)",
                Style);
-
-  // Dictionary initialisation.
-  verifyFormat(R"(//
-var myDict = new Dictionary<string, string> {
-  ["name"] = _donald,
-  ["age"] = Convert.ToString(DateTime.Today.Year - 1934),
-  ["type"] = _duck,
-};)",
-               Style);
 }
 
 TEST_F(FormatTestCSharp, CSharpNamedArguments) {