oxc icon indicating copy to clipboard operation
oxc copied to clipboard

Custom icon for config files in IDEs

Open nrayburn-tech opened this issue 1 year ago • 7 comments

IntelliJ and VS Code support using custom icons for files. The oxlint config files should be registered to use a custom icon. (IntelliJ issue https://github.com/oxc-project/oxc-intellij-plugin/issues/61)

VS Code has a few different contexts that allows different icons to be used. Supports SVG and PNG.

  • Regular (I guess dark?)
  • Light
  • High Contrast

IntelliJ has a few as well. Supports SVG, PNG is deprecated.

  • Light
  • Dark
  • Light with the new UI
  • Dark with the new UI

The same icon can be used for each one, but if there's a reason to change it based on the context then that is supported.

If somebody can provide the right SVG files to use, I can update the IDEs.

nrayburn-tech avatar Oct 13 '24 16:10 nrayburn-tech

I made a PR into vscode-icons adding our round SVG icon. We can also add it as a file icon theme in our own extension if we want, but I think this is a better solution.

https://github.com/vscode-icons/vscode-icons/pull/3604

DonIsaac avatar Oct 13 '24 17:10 DonIsaac

I think that assumes the user has that extension installed. I don’t think that’s part of the base VS Code installation. I don’t think having the icons there hurts anything, but I think they should be part of the Oxc extension too.

nrayburn-tech avatar Oct 13 '24 18:10 nrayburn-tech

In VSCode, icons are enabled/disabled as entire icon sets. If we added icons to our extension, users would have to switch to Oxc's icon theme, depriving them of all other icons. I don't think this is reasonable.

I don't currently see a way only to provide a single icon. If you know of a way, LMK and I'll get it in.

DonIsaac avatar Oct 13 '24 18:10 DonIsaac

Gotcha, that’s definitely not how I expected it to work. I’ll see if I can find some alternative, but I would agree your current approach is better given how it works.

Im fine with closing this out once that PR is merged. I should be able to take your icon files and use them for the IntelliJ plugin as well, but I’m tracking that in a separate issue.

nrayburn-tech avatar Oct 13 '24 19:10 nrayburn-tech

I found something that might work, but I'm not sure of all the implications. Maybe you know.

    "languages": [
      {
        "id": "oxc",
        "filenames": [
          "oxlintrc.json",
          "oxlint.json",
          ".oxlintrc.json",
          ".oxlint.json",
          ".oxlintrc"
        ],
        "icon": {
          "light": "icon.png",
          "dark": "icon.png"
        }
      }
    ]

https://github.com/microsoft/vscode/issues/140047 https://code.visualstudio.com/api/extension-guides/file-icon-theme#language-default-icons

nrayburn-tech avatar Oct 13 '24 20:10 nrayburn-tech

Looks like doing that doesn't recognize it as a JSON file anymore. So definitely not an option that way.

nrayburn-tech avatar Oct 13 '24 21:10 nrayburn-tech

.eslintrc.json also have their own respective icon that change only icon visual.

pumano avatar Oct 14 '24 05:10 pumano

Closed by https://github.com/vscode-icons/vscode-icons/pull/3665

Thank you @Sysix for working on the icons ❤️

Boshen avatar Jan 14 '25 07:01 Boshen

would be good to add support to https://github.com/material-extensions/vscode-material-icon-theme too.

pumano avatar Jan 17 '25 11:01 pumano