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

Adds codicons to menu commands #85635

Closed
wants to merge 3 commits into from
Closed

Adds codicons to menu commands #85635

wants to merge 3 commits into from

Conversation

eamodio
Copy link
Contributor

@eamodio eamodio commented Nov 26, 2019

This PR fixes #84695

This allows the use of codicons in menu command icons using the uri form of icon://vscode.codicons/git-commit.

//cc @jrieken

Related to: #85579 & #85624

@eamodio eamodio requested a review from jrieken November 26, 2019 22:10
@eamodio eamodio self-assigned this Nov 26, 2019
let absoluteIcon: { dark: URI; light?: URI; } | undefined;
if (icon) {
if (typeof icon === 'string') {
absoluteIcon = { dark: resources.joinPath(extension.description.extensionLocation, icon) };
if (icon.indexOf('icon://vscode.codicons/') === 0) {
iconClassName = escape(`codicon-${URI.parse(icon).path.substr(1)}`);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jrieken Not sure if I should have bothered with the URI.parse here, but wanted to keep it consistent with the other usages

@@ -367,7 +373,8 @@ commandsExtensionPoint.setHandler(extensions => {
title,
category,
precondition: ContextKeyExpr.deserialize(enablement),
iconLocation: absoluteIcon
iconLocation: absoluteIcon,
iconClassName: iconClassName
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iconClassName that shouldn't be here... I know it's not you but this stands out. We had it and spend quite some effort to get rid of this because its incompatible to Mac touch bars @misolori You seem to have added this and this is a FYI.

For this PR it means that we need to drag the URI along until it's being rendered

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iconClassName removal -> #85673

@eamodio eamodio closed this Apr 8, 2020
@github-actions github-actions bot locked and limited conversation to collaborators May 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to use codicon in menu-contributions
2 participants