Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support for .svelte files #243

Closed
websocket98765 opened this issue Nov 10, 2020 · 1 comment
Closed

Support for .svelte files #243

websocket98765 opened this issue Nov 10, 2020 · 1 comment

Comments

@websocket98765
Copy link

Love the extension! But it doesn't seem to work in .svelte files, which is a JS framework becoming very popular. They could be treated the same as .html files because each .svelte file contains three sections like this:

<script>
    // logic goes here
</script>

<style>
    /* styles go here */
</style>

<!-- HTML markup  goes here -->

Describe the bug

VS Code's comment re-wrapping does not work as expected in Svelte's javascript or HTML areas.

Steps to Reproduce

JS:

  1. In a file with .svelte extension, add a comment within the script block.
  2. Cmd + shift + P and "rewrap comment / text".

HTML:

  1. In a file with .svelte extension, add a comment within the file (not in a script or style block).
  2. Cmd + shift + P and "rewrap comment / text".

(Might help to install Svelte for VS Code extension to see

Examples

JavaScript Comments

unwrapped (initial text)

// Anim aliqua pariatur laboris laboris do fugiat aliquip aliqua ut proident. Nostrud officia ex aliquip sunt ea ipsum velit culpa enim irure voluptate minim qui id. Eiusmod eiusmod minim occaecat eiusmod sit ut quis laborum qui exercitation officia voluptate.

After current re-wrapping behavior

No change. It doesn't wrap.

// Anim aliqua pariatur laboris laboris do fugiat aliquip aliqua ut proident. Nostrud officia ex aliquip sunt ea ipsum velit culpa enim irure voluptate minim qui id. Eiusmod eiusmod minim occaecat eiusmod sit ut quis laborum qui exercitation officia voluptate.

Expected

Created by pasting the comment in a .js file in the same project and wrapping it there.

// Anim aliqua pariatur laboris laboris do fugiat aliquip aliqua ut proident.
// Nostrud officia ex aliquip sunt ea ipsum velit culpa enim irure voluptate
// minim qui id. Eiusmod eiusmod minim occaecat eiusmod sit ut quis laborum qui
// exercitation officia voluptate.

HTML Comments

unwrapped (initial text)

<!--
  Magna minim aute incididunt reprehenderit. Magna Lorem eu consequat ex elit Lorem do culpa mollit deserunt amet consectetur ea exercitation. Aliquip est voluptate deserunt nostrud eu minim Lorem sit nulla aliquip incididunt deserunt commodo.
-->

After current re-wrapping behavior (lines are longer than expected)

Lines are longer than expected, expected being the length that they wrap in a .html file in the project.

<!--
  Magna minim aute incididunt reprehenderit. Magna Lorem eu consequat ex elit Lorem do culpa mollit
  deserunt amet consectetur ea exercitation. Aliquip est voluptate deserunt nostrud eu minim Lorem
  sit nulla aliquip incididunt deserunt commodo.
-->

Expected (proper length)

Created by pasting the unwrapped comment into a .html file in the project and wrapping it there.

<!--
  Magna minim aute incididunt reprehenderit. Magna Lorem eu consequat ex elit
  Lorem do culpa mollit deserunt amet consectetur ea exercitation. Aliquip est
  voluptate deserunt nostrud eu minim Lorem sit nulla aliquip incididunt
  deserunt commodo.
-->

System:

  • OS: Mac
  • IDE: VSCode
  • Plugin/Package: Svelte for VSCode 102.5.1
stkb added a commit that referenced this issue Nov 23, 2021
- Support svelte files (HTML) (#243, #299).
@stkb
Copy link
Owner

stkb commented Nov 23, 2021

Added in v1.15.4

@stkb stkb closed this as completed Nov 23, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants