Skip to content

Commit

Permalink
Add Stacks File icon
Browse files Browse the repository at this point in the history
This adds a new file icon for the Stacks language which will apply to all tfstack.hcl and tfdeploy.hcl files.

This is a new icon for several reasons:
- The existing icon is not provided by HashiCorp, it is from the default VS Code icon theme Seti and releases to it are delivered in VS Code releases.
- We cannot reference it in our extension manifest, so we need to provide our own.
- We cannot override the Seti theme, [VS Code does not allow this](https://code.visualstudio.com/api/extension-guides/file-icon-theme#language-default-icons) and replace it.

Since this is not something we can control, we are providing our own icon to ensure we can deliver a consistent experience to our users.

To solve this a new icon was created that is similar in shape and size to the existing Seti Terraform icon and uses the Seti purple color. This ensures it is visually similar to the existing icon, which is important when the user is looking at Stack files and Terraform files in the same workspace. The one flaw is that the existing Terraform icon is slightly misaligned in the Seti theme, so any icon we provide looks slightly off. This is a [known issue](microsoft/vscode#154492) and is not something we can fix.

We could try to get the Seti icon updated, but that would require a PR to the Seti theme and a release of that theme. The Seti project does not accept new file icons lightly and does not release frequently. In addition to consume their release requires a VS Code release. There would be a long indeterminate time between submitting a new icon and a user finally seeing a correct Stacks icon.
  • Loading branch information
jpogran committed Jun 11, 2024
1 parent f90eb97 commit 8408d3f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
11 changes: 11 additions & 0 deletions assets/icons/terraform_stacks.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@
"extensions": [
".tfstack.hcl"
],
"configuration": "./language-configuration.json"
"configuration": "./language-configuration.json",
"icon": {
"dark": "assets/icons/terraform_stacks.svg",
"light": "assets/icons/terraform_stacks.svg"
}
},
{
"id": "terraform-deployment",
Expand All @@ -93,7 +97,11 @@
"extensions": [
".tfdeploy.hcl"
],
"configuration": "./language-configuration.json"
"configuration": "./language-configuration.json",
"icon": {
"dark": "assets/icons/terraform_stacks.svg",
"light": "assets/icons/terraform_stacks.svg"
}
},
{
"id": "json",
Expand Down

0 comments on commit 8408d3f

Please sign in to comment.