Skip to content

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

@gitKrystan

Description

@gitKrystan

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 😜).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions