From f2037e4b66d889b75a13f329f6636b6d2e8f3550 Mon Sep 17 00:00:00 2001 From: James Pogran Date: Tue, 2 Apr 2024 13:29:03 -0400 Subject: [PATCH] Add Stacks File icon 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](https://github.com/microsoft/vscode/issues/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. --- .../unreleased/ENHANCEMENTS-20240611-152345.yaml | 6 ++++++ assets/icons/terraform_stacks.svg | 11 +++++++++++ package.json | 12 ++++++++++-- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 .changes/unreleased/ENHANCEMENTS-20240611-152345.yaml create mode 100644 assets/icons/terraform_stacks.svg diff --git a/.changes/unreleased/ENHANCEMENTS-20240611-152345.yaml b/.changes/unreleased/ENHANCEMENTS-20240611-152345.yaml new file mode 100644 index 000000000..619184d96 --- /dev/null +++ b/.changes/unreleased/ENHANCEMENTS-20240611-152345.yaml @@ -0,0 +1,6 @@ +kind: ENHANCEMENTS +body: This adds a new file icon for the Stacks language which will apply to all tfstack.hcl and tfdeploy.hcl files +time: 2024-06-11T15:23:45.846172-04:00 +custom: + Issue: "1774" + Repository: vscode-terraform diff --git a/assets/icons/terraform_stacks.svg b/assets/icons/terraform_stacks.svg new file mode 100644 index 000000000..f872cbd8d --- /dev/null +++ b/assets/icons/terraform_stacks.svg @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/package.json b/package.json index e05e3a451..804ff2bd0 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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",