plugin inserts prettier:content when using webstorm
See original GitHub issueexample svelte project using the default template: https://github.com/theweekendgeek/svelte-prettier-example)
This s happening in WebStorm, I could not yet reproduce this in Visual Studio Code. I would assume that other IDEs from Jetbrains behave the same. Not sure If I might need to be raising this issue with them, because of the way the IDE calls Prettier for example.
How to reproduce:
- open project in webstorm
- in Settings -> Prettier: make sure prettier package is selected, add svelte extension to
Run for files
. CheckOn 'Reformat Code' action
andOn save
- open
App.svelte
- select
onMount
- type opening curly brace to surround with curly braces
- prettier:content is inserted instead of reformatted code
What I have found out so far:
-
In General I can call the
Reformat with Prettier
action without problems. I will format the code as expected, except when I have just done the sequence above and pressedundo
. In this case the same result as above will shown. -
I can workaround the issue by disabling the
On 'Reformat Code' action
option in the Prettier Settings.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top Results From Across the Web
prettier-plugin-svelte - Bountysource
plugin inserts prettier:content when using webstorm $ 0 · In General I can call the Reformat with Prettier action without problems. · I...
Read more >Install plugins | WebStorm - JetBrains
Use the Marketplace tab to browse and install plugins from the JetBrains Plugin Repository or from a custom plugin repository. Use the Installed ......
Read more >Code completion | WebStorm Documentation - JetBrains
You can create syntactically correct code constructs by using statement completion Ctrl+Shift+Enter . It inserts the necessary syntax elements ( ...
Read more >Generate code | WebStorm Documentation - JetBrains
You can also define custom templates to cover use cases specific to your workflow. You can create code constructs by inserting and expanding ......
Read more >Queries | WebStorm Documentation - JetBrains
Please note that it is a paid plugin. Configure code style for INSERT, UPDATE, WITH, SELECT, FROM, and other query structures.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Same problem here, with Webstorm. Unfortunately, entire script tag content got lost, which I only noticed some hours later, so lots of work to restore original file …
Experiencing the same issue on PhpStorm. Triggers on selecting something, then wrapping with {}. This is too complex for me to solve…
Workaround is: turn OFF prettier for “on reformat code” actions, and turn ON “on save.” Then simply use save shortcut instead of reformat.