Vscode: HTML comments not marked as comments in JavaScript

Created on 15 Oct 2019  路  6Comments  路  Source: microsoft/vscode


  • VSCode Version: 1.39.1
  • OS Version: Windows 10 Pro 10.0.18362 Build 18362

Steps to Reproduce:

  1. Create an HTML comment in a JavaScript file,
    Does this issue occur when all extensions are disabled?: Yes

*out-of-scope

All 6 comments

Why is that wrong? That is not valid javascript

@roblourens try it in a browser and then try it in node.js and then reopen this issue.
You are wrong.

This issue should be reopened, HTML comments are valid JS.

I have reported this issue in the relevant repo: microsoft/TypeScript-TmLanguage#781

OMG. You're right. Will reopen but I still feel like this would fall out of scope... what do you think @mjbvz?

While node supports these comments this is likely only as a legacy of it using V8. Our TypeScript tooling does not support or understand them, and the request has accumulated a total of 5 upvotes over the past three years

Closing as out of scope for normal js/ts files

This has nothing to do with any engines or implementations such as V8, node.js, or TypeScript.

This is to do with existing JS files that use this syntax whether you like it or not, and vscode wrongly detects it as a syntax error, in contrast to the ECMAScript spec.

Was this page helpful?
0 / 5 - 0 ratings