language-tools: Format on save not working as expected
Describe the bug
When a .svelte
document is formatted on save the indentation does not change.
To Reproduce
- Install Svelte Beta for VScode.
- Open any
.svelte
file - Save (make sure “format on save” is enabled in VScode settings).
Expected behavior I expect the code to be formatted on save.
Screenshots
An example of code not being formatted below.
System (please complete the following information):
- OS: Mac
- IDE: VScode
- Plugin/Package: Svelte Beta
Additional context
I’m using this with .editorconfig
.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 16 (8 by maintainers)
Commits related to this issue
- (feat) prettier .editorconfig support (#256) #225 — committed to sveltejs/language-tools by dummdidumm 4 years ago
- (docs) code not formatted troubleshooting #225 — committed to sveltejs/language-tools by dummdidumm 4 years ago
Yes i did. I’m pretty new to VSCode…
Now i use following Settings, which works like a charm:
Thank you all for solving this Issue!
Thanks for clarifying those points. If I get chance I’ll try re-installing VScode and trying to reproduce the issue.
Possible reason: https://github.com/sveltejs/prettier-plugin-svelte/issues/74#issuecomment-665831712
I do have the same error. The code does not get modified on save.
This only occurs in
.svelte
files, other files will get auto-formatted on save.My Output->Svelte only prints the Line
Using Svelte v3.24.0 from ....
Output->Prettier keeps empty on
.svelte
files, but works as expected and fills output on other files (eg: js, ts, …)Triggered via console
prettier --write "**/*.{css,html,js,json,md,scss,svelte,ts,yml}"
, svelte files will get auto-formatted - but not after save in vs-code.