mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-14 17:54:53 +01:00
* fix: wrap module script content in block scope to isolate variables (#229357) When multiple <script> tags exist in an HTML file, the HTML language server concatenates their content into a single virtual JavaScript document for validation. This causes false "Cannot redeclare block-scoped variable" errors when <script type="module"> tags declare variables with the same name as regular <script> tags, since module scripts should have their own scope per the HTML spec. Fix by wrapping <script type="module"> content in block scope delimiters ({ ... }) in the virtual document, preventing variable name collisions between module scripts and regular scripts. * fix: validate HTML module scripts separately * test: cover HTML module script isolation --------- Co-authored-by: Martin Aeschlimann <martinae@microsoft.com> Co-authored-by: Dmitriy Vasyura <dmitriv@microsoft.com>
Language Features for HTML
Notice: This extension is bundled with Visual Studio Code. It can be disabled but not uninstalled.
Features
See HTML in Visual Studio Code to learn about the features of this extension.
Please read the CONTRIBUTING.md file to learn how to contribute to this extension.