Bug: wrong comment syntax inside <style> tags
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+/
- By default on Windows this command is bound to
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.
@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.
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.