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
Conversation
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)}`); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iconClassName removal -> #85673
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