Add Aspire file icon for AppHost files in VS Code extension#15536
Add Aspire file icon for AppHost files in VS Code extension#15536adamint wants to merge 3 commits intomicrosoft:mainfrom
Conversation
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
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15536Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15536" |
There was a problem hiding this comment.
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-apphostlanguage with filename matches forAppHost.{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. |
extension/package.json
Outdated
| "filenames": [ | ||
| "apphost.cs", | ||
| "AppHost.cs", | ||
| "apphost.js", | ||
| "AppHost.js", | ||
| "apphost.java", | ||
| "AppHost.java", | ||
| "apphost.py", | ||
| "AppHost.py" | ||
| ], |
There was a problem hiding this comment.
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.
| "filenames": [ | |
| "apphost.cs", | |
| "AppHost.cs", | |
| "apphost.js", | |
| "AppHost.js", | |
| "apphost.java", | |
| "AppHost.java", | |
| "apphost.py", | |
| "AppHost.py" | |
| ], |
extension/package.json
Outdated
| "AppHost.py" | ||
| ], | ||
| "icon": { | ||
| "light": "./resources/aspire-file-icon.svg", |
There was a problem hiding this comment.
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.
| "light": "./resources/aspire-file-icon.svg", | |
| "light": "./resources/aspire-file-icon-light.svg", |
900ef77 to
b2edf2f
Compare
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
b2edf2f to
da0acfe
Compare
Description
Add Aspire file icon associations for AppHost files in the VS Code extension. Files named
AppHost.cs,AppHost.js,AppHost.java, andAppHost.pywill now display the Aspire logo icon in the file explorer, regardless of the user's active file icon theme.Uses the
languagescontribution point with theiconproperty, which works automatically with any icon theme. Includes both lowercase and PascalCase filename variants for cross-platform case-sensitivity support (Linux).Fixes #15533
Checklist