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: wrong comment syntax inside <style> tags #27

Open
dev-nicolaos opened this issue Jul 16, 2022 · 2 comments
Open

Bug: wrong comment syntax inside <style> tags #27

dev-nicolaos opened this issue Jul 16, 2022 · 2 comments

Comments

@dev-nicolaos
Copy link

Environment Observed In

Extension version: v0.3.5
VS Code version: 1.69.1
OS: Windows 11

Steps to reproduce

  • In a Javascript or Typescript file, paste the following:
    const markup = /*html*/`
      <style>
        
      </style>
    `;
  • Place the cursor on the blank line
  • Execute the Toggle Line Comment (command id is editor.action.commentLine) command
    • By default on Windows this command is bound to ctrl+/

Expected Behavior

The editor adds the sequence /* */ (CSS comment) in place as it does when you execute the same command inside a <style> tag in an HTML file.

Observed Behavior

The editor adds the sequence <!-- --> (HTML comment) in place.

@pushqrdx
Copy link
Owner

@dev-nicolaos yeah i know about this issue although i haven't figured out exactly why does vscode do this, because the html language server is able to understand the <style> blocks in normal html files.

@conor-dowdall
Copy link

As a workaround, you can bind the command "Emmet: Toggle Comment" to a keyboard shortcut (maybe Ctrl + Shift + /) and use that to comment HTML and/or CSS in a template string.

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

3 participants