Skip to content

Issue in indentation when formatting consecutive objects #6271

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

Open
louy opened this issue Dec 28, 2015 · 4 comments
Open

Issue in indentation when formatting consecutive objects #6271

louy opened this issue Dec 28, 2015 · 4 comments
Labels
Bug A bug in TypeScript Domain: Formatter The issue relates to the built-in formatter Help Wanted You can do this
Milestone

Comments

@louy
Copy link

louy commented Dec 28, 2015

Reposting microsoft/vscode#1661

There's a very annoying issue when hitting "format code" in a TS file. Here's an example:

[{
}, {
}]
// or
fn({
}, {
})

becomes:

[{
}, {
  }]
// or
fn({
}, {
  })

This gets really annoying when you have large nested objects containing things like functions etc...

@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Domain: Formatter The issue relates to the built-in formatter labels Dec 28, 2015
@saschanaz
Copy link
Contributor

Related with #5834.

@mhegazy mhegazy added this to the Community milestone Feb 24, 2016
@mhegazy mhegazy added the Help Wanted You can do this label Feb 24, 2016
@louy
Copy link
Author

louy commented Mar 30, 2016

This issue is really annoying me. Can someone at least point me to where I should be looking at? I can probably fix it myself.

@RyanCavanaugh
Copy link
Member

@saschanaz has fixed a bunch of formatting issues in the past. You can look at their PRs (https://github.com/Microsoft/TypeScript/pulls?utf8=%E2%9C%93&q=author%3ASaschaNaz) to get a rough idea of how the formatter works.

@saschanaz
Copy link
Contributor

I have #3827 to fix this, maybe someone can suggest something or just make a better one.

@RyanCavanaugh RyanCavanaugh modified the milestones: Community, Backlog Mar 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Formatter The issue relates to the built-in formatter Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

5 participants