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 icons contribution point #117263

Closed
2 tasks done
aeschli opened this issue Feb 22, 2021 · 2 comments
Closed
2 tasks done

Test icons contribution point #117263

aeschli opened this issue Feb 22, 2021 · 2 comments

Comments

@aeschli
Copy link
Contributor

aeschli commented Feb 22, 2021

Refs: #114942

Complexity: 4

Create Issue


The icon contribution point allow extensions to define a new icon by id, along with a default icon.
That icon id can then be used by the extension (or any other extensions that depend on the extension) at the places where ThemeIcon can be used.

  • Product icon themes can redefine the icon (if they know about the icon id)

Create an extension that contributes an icon and use it.

"contributes": {
	"icons": [
		{
			"id": "distro-ubuntu",
			"description": "Ubuntu icon",
			"default": {
				"iconFontId": "distro-icon-font",
				"character": "\\E001"
			}
		},
		{
			"id": "distro-fedora",
			"description": "Fedora icon",
			"default": {
				"iconFontId": "distro-icon-font",
				"character": "\\E002"
			}
		}
	],
	"iconFonts": [
		{
			"id": "distro-icon-font",
			"src": [
				{
					"path": "./distroicons.woff",
					"format": "woff"
				}
			]
		}
	]
}

In this example, an extension defines two new icon ids distro-ubuntu and distro-fedora along with default icon definitions. The icons are defined in an icon font at the given font character. The icon font is defined in a new contribution point iconFonts.

The product-icon-theme-sample can be used as the icon font. It also contains a script build create an icon font from svgs.

  • test that the code completion, hovers and validation work when authoring an icon and icon font contribution
  • test that the icon identifier must consist of at least two segments separated by minus (needs a new I-Build)
  • test that that the icon ids (e.g. distro-ubuntu and distro-fedora) can be used in markdown strings ("$(distro-ubuntu)" Ubuntu 20.04") and at all places that take a ThemeIcon ( new ThemeIcon("distro-ubuntu"))
  • test that the icon id can also be used by other extensions (if they know about the icon id)
  • test that a product icon themes can redefine the icon (you can test this with the product-icon-theme-sample )
@aeschli aeschli added this to the February 2021 milestone Feb 22, 2021
@aeschli aeschli changed the title Test : icon contribution point Test : icons contribution point Feb 22, 2021
@ghost ghost assigned miguelsolorio and rzhao271 Feb 23, 2021
@aeschli aeschli changed the title Test : icons contribution point Test icons contribution point Feb 23, 2021
@eamodio eamodio assigned eamodio and unassigned rzhao271 Feb 23, 2021
@miguelsolorio miguelsolorio removed their assignment Feb 24, 2021
@miguelsolorio
Copy link
Contributor

miguelsolorio commented Feb 24, 2021

This is very cool and excited to see extensions use this:

image

@eamodio
Copy link
Contributor

eamodio commented Feb 25, 2021

Looks great! Can't wait for this to ship.

@eamodio eamodio closed this as completed Feb 25, 2021
@eamodio eamodio removed their assignment Mar 16, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2021
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

4 participants