Skip to content

Add Aspire file icon for AppHost files in VS Code extension#15536

Closed
adamint wants to merge 3 commits intomicrosoft:mainfrom
adamint:dev/adamint/file-icons-apphost-extension
Closed

Add Aspire file icon for AppHost files in VS Code extension#15536
adamint wants to merge 3 commits intomicrosoft:mainfrom
adamint:dev/adamint/file-icons-apphost-extension

Conversation

@adamint
Copy link
Member

@adamint adamint commented Mar 24, 2026

Description

Add Aspire file icon associations for AppHost files in the VS Code extension. Files named AppHost.cs, AppHost.js, AppHost.java, and AppHost.py will now display the Aspire logo icon in the file explorer, regardless of the user's active file icon theme.

Uses the languages contribution point with the icon property, which works automatically with any icon theme. Includes both lowercase and PascalCase filename variants for cross-platform case-sensitivity support (Linux).

Fixes #15533

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
    • No
  • Does the change require an update in our Aspire docs?
    • Yes
    • No

adamint added 2 commits March 24, 2026 10:17
Register a language contribution that associates AppHost.cs, AppHost.js,
AppHost.java, and AppHost.py files with the Aspire logo icon in both light
and dark themes. Includes both lowercase and PascalCase filename variants
for cross-platform case-sensitivity support.

Fixes microsoft#15533
Copilot AI review requested due to automatic review settings March 24, 2026 17:19
@github-actions
Copy link
Contributor

github-actions bot commented Mar 24, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15536

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15536"

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Aspire-branded file icons for AppHost.* files in the VS Code extension using the contributes.languages[].icon mechanism.

Changes:

  • Added new Aspire SVG icon assets (regular and light variants).
  • Contributed a new aspire-apphost language with filename matches for AppHost.{cs,js,java,py} (plus lowercase variants) and associated an icon.

Reviewed changes

Copilot reviewed 1 out of 3 changed files in this pull request and generated 2 comments.

File Description
extension/resources/aspire-file-icon.svg Adds the Aspire file icon SVG asset.
extension/resources/aspire-file-icon-light.svg Adds a light-theme SVG variant for the icon.
extension/package.json Registers a new contributed language and associates icons with AppHost.* filenames.

Comment on lines +45 to +54
"filenames": [
"apphost.cs",
"AppHost.cs",
"apphost.js",
"AppHost.js",
"apphost.java",
"AppHost.java",
"apphost.py",
"AppHost.py"
],
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registering these filenames under a new contributes.languages id will cause VS Code to assign the aspire-apphost language mode to AppHost.cs/js/java/py. That will override the expected C#/JS/Java/Python language services (syntax highlighting, IntelliSense, formatting, etc.) for these files. If the goal is icon-only, this approach has a significant side effect; consider using a file-icon-theme based solution (even if user-selected), or an approach that does not change the document language mode.

Suggested change
"filenames": [
"apphost.cs",
"AppHost.cs",
"apphost.js",
"AppHost.js",
"apphost.java",
"AppHost.java",
"apphost.py",
"AppHost.py"
],

Copilot uses AI. Check for mistakes.
"AppHost.py"
],
"icon": {
"light": "./resources/aspire-file-icon.svg",
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A separate light asset (resources/aspire-file-icon-light.svg) is added in this PR, but icon.light and icon.dark both point to the same file. Either wire icon.light to ./resources/aspire-file-icon-light.svg (if intended), or remove the unused light asset to avoid confusion and dead files.

Suggested change
"light": "./resources/aspire-file-icon.svg",
"light": "./resources/aspire-file-icon-light.svg",

Copilot uses AI. Check for mistakes.
@adamint adamint force-pushed the dev/adamint/file-icons-apphost-extension branch 5 times, most recently from 900ef77 to b2edf2f Compare March 24, 2026 19:36
Register an icon theme that associates AppHost.cs, AppHost.js,
AppHost.java, and AppHost.py files with the Aspire logo icon.
The icon theme fileNames matching is case-insensitive.

Fixes microsoft#15533
@adamint adamint force-pushed the dev/adamint/file-icons-apphost-extension branch from b2edf2f to da0acfe Compare March 24, 2026 19:38
@adamint adamint closed this Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add apphost file associations

2 participants