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

VSCode auto formatter compresses each loop to single line #451

Closed
georgebzhang opened this issue Aug 12, 2020 · 3 comments
Closed

VSCode auto formatter compresses each loop to single line #451

georgebzhang opened this issue Aug 12, 2020 · 3 comments
Labels
bug Something isn't working Fixed Fixed in master branch. Pending production release.

Comments

@georgebzhang
Copy link

Describe the bug
{#each items as item}
{item}
{/each}

gets automatically formatted (Option + Shift + F) in VSCode to

{#each items as item}{item}{/each}

Would much prefer if the auto formatter did not compress the each loop to a single line.

To Reproduce
Steps to reproduce the behavior:

For example a code snippet that is treated in a way you don't expect.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

System (please complete the following information):

  • OS: Macbook Pro 2018
  • IDE: VSCode
  • Plugin/Package: Svelte for VSCode

Additional context
Add any other context about the problem here.

@georgebzhang georgebzhang added the bug Something isn't working label Aug 12, 2020
@dummdidumm
Copy link
Member

The source of this problem is prettier-plugin-svelte which does the formatting. Could you open the issue over there?

@georgebzhang
Copy link
Author

Thank you, @dummdidumm, just opened the issue: sveltejs/prettier-plugin-svelte#117

dummdidumm added a commit that referenced this issue Jan 13, 2021
Make some prettier options configurable

### BREAKING CHANGE
Bump to prettier-plugin-svelte 2.1.0 -> different formatting
#451 , #721
@dummdidumm dummdidumm added the Fixed Fixed in master branch. Pending production release. label Jan 13, 2021
@dummdidumm
Copy link
Member

prettier-plugin-svelte 2.x now keeps newlines if the user desires it. The extension now comes prepacked with the newest version. If you use prettier-plugin-svelte locally within your project, you need to bump that version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Fixed Fixed in master branch. Pending production release.
Projects
None yet
Development

No branches or pull requests

2 participants