prettier-plugin-ember-template-tag
prettier-plugin-ember-template-tag copied to clipboard
[Bug] Does not work with VSCode `formatOnPaste` config
Documenting a bug reported here: https://github.com/gitKrystan/prettier-plugin-ember-template-tag/issues/43#issuecomment-1511209555 by @jurgenwerk
🐞 Describe the Bug
If a user has "editor.formatOnPaste": true in their VSCode config and pastes code within a <template> tag, prettier will transform <template> in the source file to its internal representation format (__GLIMMER_TEMPLATE()).
🔬 Minimal Reproduction
I have been unable to reproduce.
😕 Actual Behavior vs. 🤔 Expected Behavior
➕ Additional Context
Per https://github.com/prettier/prettier-vscode/issues/343, formatOnPaste uses a prettier range formatter. This library currently does no special handling re: range formatting, and that's probably the issue here.
For now, I recommend people setting "editor.formatOnPaste": false for gjs/gts files, and comment here to let me know you care about this issue (or open a PR to fix it 😜).
I encounter the same behavior in Jetbrains IDEs (Intellij in my case), but when saving the file, which is more problematic: I cannot use Prettier on .gts files at all.
Not sure how Prettier usage is implemented in those IDEs, or how this could be fixed?