Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"keep array indentation" not working #333

Closed
mvolkmann opened this issue Oct 11, 2013 · 6 comments
Closed

"keep array indentation" not working #333

mvolkmann opened this issue Oct 11, 2013 · 6 comments

Comments

@mvolkmann
Copy link

The two attached screen shots show some simple input and output that demonstrate the issue. Also notice the incorrect closing brace indentation for the objects inside the array property "two".

This is the input:
input

This is the output:
output

@mvolkmann
Copy link
Author

I should add that what I expected was for no changes to be made to the input code.

@bitwiseman
Copy link
Member

Input:

function foo() {
  return [
    {
      one: 'x',
      two: [
        {
          id: 'a',
          name: 'apple'
        },
        {
          id: 'b',
          name: 'banana'
        }
      ]
    }
  ];
}

Actual Output:

function foo() {
  return [{
      one: 'x',
      two: [
        {
          id: 'a',
          name: 'apple'
          },
        {
          id: 'b',
          name: 'banana'
          }
        ]
  }];
}

@bitwiseman
Copy link
Member

Interesting bug.
All of these inputs work as expected - the input remains unchanged:

function foo() {
  return [{
    one: 'x',
    two: [
      {
        id: 'a',
        name: 'apple'
      },
      {
        id: 'b',
        name: 'banana'
      }
    ]
  }];
}

function foo() {
  a = [
    {
      one: 'x',
      two: [
        {
          id: 'a',
          name: 'apple'
        },
        {
          id: 'b',
          name: 'banana'
        }
      ]
    }
  ];
  return a;
}

foo(
  [
    {
      one: 'x',
      two: [
        {
          id: 'a',
          name: 'apple'
        },
        {
          id: 'b',
          name: 'banana'
        }
      ]
    }
  ]);

foo([
  {
    one: 'x',
    two: [
      {
        id: 'a',
        name: 'apple'
      },
      {
        id: 'b',
        name: 'banana'
      }
    ]
  }
]);

So, we have a hole in our test matrix, which maybe specific to the return statement logic.

@mvolkmann
Copy link
Author

Did a recent change fix it? I cannot reproduce the problem in the Web UI
now.

On Thu, Nov 7, 2013 at 3:12 PM, Liam Newman [email protected]:

Interesting bug.
This code works - the input remains unchanged:

function foo() {
return [{
one: 'x',
two: [
{
id: 'a',
name: 'apple'
},
{
id: 'b',
name: 'banana'
}
]
}];}


Reply to this email directly or view it on GitHubhttps://github.com//issues/333#issuecomment-28006791
.

R. Mark Volkmann
Object Computing, Inc.

@bitwiseman
Copy link
Member

It's there, I can still repro it, double check your settings.

@mvolkmann
Copy link
Author

Perhaps I misunderstood. I copied the code from your email today, pasted it
into the Web UI, kept all the default settings, and pressed the "Beautify"
button. I was expecting it to incorrectly change the indentation of the
closing array brace, but it didn't. I thought that indicated that the
problem has been fixed.

On Thu, Nov 7, 2013 at 3:53 PM, Liam Newman [email protected]:

It's there, I can still repro it, double check your settings.


Reply to this email directly or view it on GitHubhttps://github.com//issues/333#issuecomment-28010234
.

R. Mark Volkmann
Object Computing, Inc.

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

No branches or pull requests

2 participants