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

[Bug] Does not work with VSCode formatOnPaste config #53

Open
gitKrystan opened this issue Apr 19, 2023 · 1 comment
Open

[Bug] Does not work with VSCode formatOnPaste config #53

gitKrystan opened this issue Apr 19, 2023 · 1 comment

Comments

@gitKrystan
Copy link
Collaborator

gitKrystan commented Apr 19, 2023

Documenting a bug reported here: #43 (comment) 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

image

➕ Additional Context

Per prettier/prettier-vscode#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 😜).

@pbernery
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants