fix: modernize HTML sample snippet (#304818)

Update the built-in HTML sample snippet to follow current web standards
and reduce unnecessary boilerplate:

- Add lang attribute to <html> tag as first tab stop (W3C recommended)
- Remove outdated IE compatibility meta tag (IE is no longer supported)
- Remove unnecessary type='text/css' and media='screen' from <link>
  (default values in HTML5)
- Remove <script> tag (modern templates often handle scripts differently)
- Move viewport meta before title (following common convention)

Fixes #272331

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>
This commit is contained in:
Yogeshwaran C
2026-03-27 22:55:15 +05:30
committed by GitHub
parent dd064da408
commit 7466d76783

View File

@@ -317,14 +317,12 @@ async function startClientWithParticipants(languageParticipants: LanguagePartici
const snippetProposal = new CompletionItem('HTML sample', CompletionItemKind.Snippet);
snippetProposal.range = range;
const content = ['<!DOCTYPE html>',
'<html>',
'<html lang=\'${1:en}\'>',
'<head>',
'\t<meta charset=\'utf-8\'>',
'\t<meta http-equiv=\'X-UA-Compatible\' content=\'IE=edge\'>',
'\t<title>${1:Page Title}</title>',
'\t<meta name=\'viewport\' content=\'width=device-width, initial-scale=1\'>',
'\t<link rel=\'stylesheet\' type=\'text/css\' media=\'screen\' href=\'${2:main.css}\'>',
'\t<script src=\'${3:main.js}\'></script>',
'\t<title>${2:Page Title}</title>',
'\t<link rel=\'stylesheet\' href=\'${3:main.css}\'>',
'</head>',
'<body>',
'\t$0',