Copilot commented on code in PR #1588:
URL: https://github.com/apache/camel-karavan/pull/1588#discussion_r2700622781


##########
karavan-vscode/icons/camel.json:
##########
@@ -0,0 +1,11 @@
+{
+  "iconDefinitions": {
+    "_camel-yaml": {
+      "iconPath": "./camel-yaml.svg"
+    }
+  },
+  "fileExtensions": {
+    "camel.yaml": "_camel-yaml",
+    "camel.yml": "_camel-yaml"

Review Comment:
   According to VS Code's file icon theme specification, the `fileExtensions` 
object should map file extensions to icon IDs. However, for compound extensions 
like "file.camel.yaml", only the last extension part is used by VS Code (i.e., 
"yaml"). To match files with patterns like "*.camel.yaml", you need to use the 
`fileNames` property instead, with patterns like "*.camel.yaml" and 
"*.camel.yml". The current implementation will not correctly match these files.
   ```suggestion
     "fileNames": {
       "*.camel.yaml": "_camel-yaml",
       "*.camel.yml": "_camel-yaml"
   ```



##########
karavan-vscode/package.json:
##########
@@ -714,6 +714,13 @@
         "view": "integrations",
         "contents": "No integrations found.\n [Create 
Integration](command:karavan.create-yaml)"
       }
+    ],
+    "iconThemes": [
+      {
+        "id": "karavan",
+        "label": "Karavan",
+        "path": "icons/camel.json"
+      }

Review Comment:
   The `iconThemes` contribution point is designed to replace the entire file 
icon theme in VS Code, not to augment the existing theme with specific file 
icons. When a user selects the "Karavan" icon theme, all file icons will be 
replaced with this theme's definitions, and only files matching "*.camel.yaml" 
and "*.camel.yml" will have icons - all other files will have no icons.
   
   The correct approach for adding custom icons for specific file extensions is 
to use the `contributes.icons` contribution point combined with 
`contributes.languages` or file associations. Alternatively, consider using the 
approach of declaring file icon associations as part of the language definition 
if you have language support for these files.
   ```suggestion
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to