Skip to content

Incorrect indentation with nested literal objects/arrays #469

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

Closed
TamsynUlthara opened this issue Jun 9, 2016 · 7 comments
Closed

Incorrect indentation with nested literal objects/arrays #469

TamsynUlthara opened this issue Jun 9, 2016 · 7 comments

Comments

@TamsynUlthara
Copy link
Contributor

Commit d54b138 broke indentation in the following case (and also with literal arrays):

a = {
  b: {
    c: {
    },
  },
  d: {
      // indents to here
    // should indent to here, instead
  },
}

The issue doesn't arise if the trailing comma from c is removed.

The issue exists on the develop branch as well.

@bounceme
Copy link
Collaborator

bounceme commented Jun 9, 2016

fixed in 'bounceme-patch-1' branch, still needs #466 though

@bounceme
Copy link
Collaborator

can you try out develop again? this should be closable

@amadeus
Copy link
Collaborator

amadeus commented Jun 12, 2016

Working for me. Will close this unless someone can reproduce.

@amadeus amadeus closed this as completed Jun 12, 2016
@TamsynUlthara
Copy link
Contributor Author

Looks good to me on develop. Thanks!

@iryan2
Copy link

iryan2 commented Jun 14, 2016

Broken for me on develop, depending on where the trailing comma is. It's when it appears on the last line of the last item:
screen shot 2016-06-14 at 12 38 06 pm

But not if the trailing comma appears earlier in the collection:
screen shot 2016-06-14 at 12 41 09 pm
and
screen shot 2016-06-14 at 12 43 09 pm

Sorry if this isn't directly related to the originally reported issue, didn't want to spam your issue tracker :P

@bounceme
Copy link
Collaborator

bounceme commented Jun 14, 2016

are you sure there isn't any conflicting syntax script?could you paste the examples as markdown, i'll be testing this later

@bounceme
Copy link
Collaborator

bounceme commented Jun 14, 2016

oh there is a problem still

var a = [
  {
    id: 1,
  } , {
      id: 2,
    }
];

edit: should be fixed in my new branch

bounceme added a commit that referenced this issue Jun 14, 2016
bounceme added a commit that referenced this issue Jun 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants