Skip to content

Extra indentation added on wrapped constructor arguments #1260

Closed

Description

@mihaipopescu

I'm seeing the formatter change this (wrapped lines indented 1 tab more than first):

                         devicePositions[device] = rect = new Rect(
                             Vector2.Lerp(rect.position, target.position, 0.1f),
                             Vector2.Lerp(rect.size, target.size, 0.1f));

to this (wrapped lines indented 3 tabs more than first):

                         devicePositions[device] = rect = new Rect(
                                     Vector2.Lerp(rect.position, target.position, 0.1f),
                                     Vector2.Lerp(rect.size, target.size, 0.1f));

Expected versus output diff:

diff --git "a/C:\\work\\external\\uncrustify\\tests\\output\\staging\\60012-UNI-12303.cs" "b/C:\\work\\external\\uncrustify\\tests\\results\\staging\\60012-UNI-12303.cs"
index 01be829..29bd878 100644
--- "a/C:\\work\\external\\uncrustify\\tests\\output\\staging\\60012-UNI-12303.cs"
+++ "b/C:\\work\\external\\uncrustify\\tests\\results\\staging\\60012-UNI-12303.cs"
@@ -1,4 +1,4 @@
 //This gets a double indentation
 devicePositions[device] = rect = new Rect(
-    Vector2.Lerp(rect.position, target.position, 0.1f),
-    Vector2.Lerp(rect.size, target.size, 0.1f));
+            Vector2.Lerp(rect.position, target.position, 0.1f),
+            Vector2.Lerp(rect.size, target.size, 0.1f));

Debug support files:

60012-UNI-12303.cs
60012-UNI-12303.cs.log
60012-UNI-12303.cs.unc
Uncrustify.CSharp.cfg
UNI-12303.cs

Disclaimer:

Note: This is a generated issue from our internal issue tracker.
Expect a dry description which could be insufficient to properly understand the issue.
On the other hand, the support files should be sufficient to easily reproduce and debug the issue,
but please comment if it's still unclear and I will get back with clarifications.
See main discussion thread here #1223.

Activity

  1. CDanU commented on Jul 13, 2017

    @CDanU
    Collaborator

    Caused by:

    # Align continued statements at the '='. Default=True
    # If False or the '=' is followed by a newline, the next line is indent one tab.
    indent_align_assign             = false    # false/true

    is indent one tab.

    Needs to be changed

  2. mihaipopescu commented on Jul 18, 2017

    @mihaipopescu
    CollaboratorAuthor

    I don't get where we have an extra indentation from. Is it the new or the = ?

    I think it could be from = as we have another related issue (not reported yet):

        m_Map[VeryLongEnumKey_1].ptr
            = m_Map[VeryLongEnumKey_2].ptr
                    = m_Map[VeryLongEnumKey_3].ptr
                            = m_Map[VeryLongEnumKey_4].ptr
                                    = m_Map[VeryLongEnumKey_5].ptr
                                            = m_Map[VeryLongEnumKey_6].ptr;

    where all these assignments are indented when we want them without indent.

  3. added a commit that references this issue on Oct 25, 2017
  4. gmaurel commented on Jan 22, 2018

    @gmaurel
    Collaborator

    Fixed at db6adb6, Dec 20 20:25:54 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions