Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test language default icon #141335

Closed
2 tasks done
aeschli opened this issue Jan 24, 2022 · 2 comments
Closed
2 tasks done

Test language default icon #141335

aeschli opened this issue Jan 24, 2022 · 2 comments

Comments

@aeschli
Copy link
Contributor

aeschli commented Jan 24, 2022

Testing #14662

Complexity: 4

Create Issue


Language contributors can now define an icon for the language.

{
  "contributes": {
    "languages": [
      {
        "id": "latex",
        // ...
        "icon": {
          "light": "./icons/latex-light.png",
          "dark": "./icons/latex-dark.png"
        }
      }
  ]

The icon is used by file icon themes as fallback if they don't have an icon for the language. The rules are:

  • the file icon theme defines at least one file icon (not just a generic icon for all files such as the Minimal theme)
    -> default language icons do not show in file icon themes like Minimal or None
  • the file icon theme does not define a specific icon for the language
  • icons defined for file extensions or file names always win against the language icon (no change)
  • file icon themes can override this default behavior by defining showLanguageModeIcons: true|false in the theme file.
    • showLanguageModeIcons: true shows the default language icons even if the theme does not specify specific file icons (like the Minimal theme)
    • showLanguageModeIcons: false prevents that default language icons are used.

Test

  • create an extension that creates a new language with an icon
  • test that the built-ion set theme shows the icon, but not the Minimal or None theme
  • test some other file icon themes from the Marketplace. They should show the icon unless they are simple themes like the Minimal theme
  • create a file icon theme (eg. modify/copy the Seti theme)
    • add showLanguageModeIcons: false: The default language icon should not be shown
    • define an icon for the language in the theme. That icon from the theme should show instead of the default language icon

https://code.visualstudio.com/api/extension-guides/file-icon-theme has more information on file icon themes

@aeschli aeschli added this to the January 2022 milestone Jan 24, 2022
@ghost ghost assigned JacksonKearl and bpasero Jan 25, 2022
@bpasero bpasero removed their assignment Jan 25, 2022
@bpasero
Copy link
Member

bpasero commented Jan 25, 2022

I am not sure I was able to test the showLanguageModeIcons thing.

@JacksonKearl
Copy link
Contributor

JacksonKearl commented Jan 26, 2022

Very cool!
image

re showLanguageModeIcons , I found that if it's unset or true in ayu-icons.json, my language extension's icon gets used. If its false, then the icon theme's icon gets used. I think this is the expected behaviour. I saw surprised to see it respond live when editing ~/.vscode-insiders/extensions/...

@JacksonKearl JacksonKearl removed their assignment Jan 26, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Mar 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants