-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
Allow to contribute to icon registry from icon contribution point #114942
Comments
I pushed new contribution points as proposed API:
In this example, an extension defines two new icon ids
Current limitations:
Feedback is welcome! |
@aeschli This is AWESOME! I'm a bit concerned about the uniqueness, and having extension collisions with our names as they evolve. What happens if an id is a defined codicon and contributed by an extension? What happens if 2 extensions contribute the same id?
What is the implication of this? Other extensions can't define new icon names from that font? |
@eamodio Yes, right now it's one big icon namespace: The built-in icon ids as well as the contributed icon ids. Agree that some qualifier would be good. Either enforced or by convention. I wasn't sure if reusing an icon font across extensions is needed/useful/a good idea. But let me know if you have a good use case for sharing of fonts. |
Forcing the extension id is ugly as you said, but maybe there should be a required prefix on each icon? And the prefix would just be added to the id, e.g.
Nope, just making sure I understood properly. Makes sense to me. |
I think it would be OK (actually, advisable) to prefix the icon id with the extension id when adding it to the registry. For instance if extension If publishers want to minimize the length of their icon ids they could publish an extension that just contributes the icon(s) and icon font(s), giving that extension a short name, e.g. |
Just wanna say that we have the same challenge with command ids. With them it's up to extensions and that hasn't turned out to be big problem. |
Yeah, but at least with commands our getting started/scaffolding contains a command that is namespaced, so it's easier to fall into the desired pattern. But at the same time, I agree it isn't much of an issue -- we should just recommend a prefix in the docs. |
I will change to allow to have dots in icon names and I will show an error (or warning?) if the icon contribution id doesn't contain a dot. |
I added a check that the icon name consists of at least two segments separated by a minus |
As discussed in #117492, I renamed I updated the sample in #114942 (comment) |
Extracted from #92791.
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 other extensions that depend on the extension) at the places where
ThemeIcon
can be used.The text was updated successfully, but these errors were encountered: