Skip to content

add config to insert space for empty braces #35427

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

Conversation

davidkwan95
Copy link
Contributor

Fixes #28678
Add a new config insertSpaceAfterOpeningAndBeforeClosingEmptyBraces. For example:

Before formatting

constructor() {        }

When the config is set to true:

constructor() { }

When set to false:

constructor() {}

@msftclas
Copy link

msftclas commented Nov 30, 2019

CLA assistant check
All CLA requirements met.

@ghost
Copy link

ghost commented Nov 30, 2019

Does this need a doc update as well?

@sandersn sandersn added the For Backlog Bug PRs that fix a backlog bug label Feb 3, 2020
@galangel
Copy link

can you merge this?

Copy link
Member

@andrewbranch andrewbranch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this! Looks reasonable to me. To be broadly useful, it needs a corresponding PR to the typescript-language-features extension in VS Code. You can use this one as a template.

It will also need some changes in Visual Studio for those users to take advantage of it, so pinging @jessetrinity for awareness.

Copy link
Contributor

@orta orta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I'm good for this too - let's get this in.

Thanks @davidkwan95! As Andrew recommended, to make this useable you'll need to be able to set the config in your editor, so I'd head over to VSCode and add that and we'll make sure the VS team know.

@orta orta merged commit 4406717 into microsoft:master Mar 12, 2020
@davidkwan95 davidkwan95 deleted the feature/config-insert-space-for-empty-braces branch March 14, 2020 09:51
@davidkwan95
Copy link
Contributor Author

I'm a little bit busy this week and probably next week too, so maybe another person can help make a PR to the VSCode repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

No Space between empty Brackets
6 participants