Skip to content

tsx attribute formatting removes bracket spacing #10872

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
waderyan opened this issue Sep 12, 2016 · 4 comments
Closed

tsx attribute formatting removes bracket spacing #10872

waderyan opened this issue Sep 12, 2016 · 4 comments
Labels
Fixed A PR has been merged for this issue VS Code Tracked There is a VS Code equivalent to this issue

Comments

@waderyan
Copy link

From @bookman25 on September 9, 2016 18:8

  • VSCode Version: 1.5.1
  • OS Version: Windows 10

Steps to Reproduce:

  1. TypeScript Version: 2.*
  2. <input value={ this.state.value } />
  3. Format document

Expected behavior:
In 1.8.10 the spacing inside the brackets was unchanged on format operation (closing bracket } or format document).
<input value={ this.state.value } />

Actual behavior:
In 2.* the space inside the brackets is always removed when formatting.

<input value={this.state.value} />

Looks like it might be related to: #9361

Copied from original issue: microsoft/vscode#11791

@saschanaz
Copy link
Contributor

VSCode should support InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces, I'm not sure currently it does.

@waderyan waderyan added the VS Code Tracked There is a VS Code equivalent to this issue label Sep 14, 2016
@waderyan
Copy link
Author

Issue added to September milestone on VS Code's side.

@waderyan waderyan reopened this Sep 14, 2016
@mhegazy
Copy link
Contributor

mhegazy commented Sep 14, 2016

as noted by @saschanaz, this already fixed in #9361. You will need to specify the formatting option InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false.

@mhegazy mhegazy closed this as completed Sep 14, 2016
@mhegazy mhegazy added Fixed A PR has been merged for this issue and removed Fixed A PR has been merged for this issue labels Sep 14, 2016
@mhegazy
Copy link
Contributor

mhegazy commented Sep 14, 2016

the VSCode setting would be:

"typescript.format.InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Fixed A PR has been merged for this issue VS Code Tracked There is a VS Code equivalent to this issue
Projects
None yet
Development

No branches or pull requests

3 participants