From 0f208447ed78ba3bc7a3d7cee17f516bd18a67f2 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 5 Mar 2026 23:52:14 -0800 Subject: [PATCH] Prefer base HTML icon for .html files - Override `.html` language mapping to use the generic HTML icon - Add test coverage asserting `index.html` resolves to `file_type_html.svg` --- apps/web/src/vscode-icons.test.ts | 2 ++ apps/web/src/vscode-icons.ts | 3 +++ 2 files changed, 5 insertions(+) diff --git a/apps/web/src/vscode-icons.test.ts b/apps/web/src/vscode-icons.test.ts index b00cf0cdc0933706b751c085b8e11f6a90679f8e..e03f5a4c3619cb2faa68790b958a3704c4327f5d 100644 --- a/apps/web/src/vscode-icons.test.ts +++ b/apps/web/src/vscode-icons.test.ts @@ -30,12 +30,14 @@ describe("getVscodeIconUrlForEntry", () => { const tsxUrl = getVscodeIconUrlForEntry("checkbox.tsx", "file", "light"); const dockerfileUrl = getVscodeIconUrlForEntry("Dockerfile", "file", "dark"); const shellUrl = getVscodeIconUrlForEntry("entrypoint.sh", "file", "dark"); + const htmlUrl = getVscodeIconUrlForEntry("index.html", "file", "dark"); const cursorRulesUrl = getVscodeIconUrlForEntry("general.mdc", "file", "dark"); const githubWorkflowUrl = getVscodeIconUrlForEntry(".github/workflows/ci.yml", "file", "light"); assert.isTrue(tsxUrl.endsWith("/file_type_reactts.svg")); assert.isTrue(dockerfileUrl.endsWith("/file_type_docker.svg")); assert.isTrue(shellUrl.endsWith("/file_type_shell.svg")); + assert.isTrue(htmlUrl.endsWith("/file_type_html.svg")); assert.isTrue(cursorRulesUrl.endsWith("/file_type_markdown.svg")); assert.isTrue(githubWorkflowUrl.endsWith("/file_type_light_yaml.svg")); }); diff --git a/apps/web/src/vscode-icons.ts b/apps/web/src/vscode-icons.ts index e2c0d95834270fcc0a8122d3942b9b72a34f220c..3d9a59702b4088f6dcc3c5ca112b80433f00fcbd 100644 --- a/apps/web/src/vscode-icons.ts +++ b/apps/web/src/vscode-icons.ts @@ -45,6 +45,9 @@ const languageIdByFileName = toLowercaseLookup(languageAssociations.fileNameToLa const localLanguageIdByExtensionOverrides = { // Cursor rules files (*.mdc) are commonly treated as markdown in VSCode/Cursor. mdc: "markdown", + // Upstream languages.ts currently maps .html to django-html before html. + // Prefer the base HTML icon for standalone HTML files. + html: "html", // Upstream languages.ts maps yml/yaml to specialized language ids that can produce // non-generic YAML icons (for example cloudfoundry/esphome). Prefer the base YAML icon // unless a more specific basename/extension match (e.g. azure-pipelines.yml) is found. -- 2.54.0