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>