-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[vscode] support theme icons #8267
Conversation
themeIcon = icon; | ||
} else { | ||
iconUrl = this.toPluginUrl(pck, icon); | ||
} | ||
} else { | ||
iconUrl = { | ||
light: this.toPluginUrl(pck, icon.light), |
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.
I guess since icons from the theme implicitly have a light/dark form, it would be wrong to reference them here, right?
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.
yes, checked with VS Code that it does not expect codeicons here
@@ -43,8 +43,11 @@ export class PluginTreeViewNodeLabelProvider implements LabelProviderContributio | |||
return node.icon; | |||
} | |||
if (node.themeIconId) { | |||
const uri = node.resourceUri && new URI(node.resourceUri) || undefined; | |||
return this.labelProvider.getIcon(URIIconReference.create(node.themeIconId, uri)); | |||
if (node.themeIconId === 'file' || node.themeIconId === 'folder') { |
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.
Are these two special-cased so we can get stuff like the "Java" icon for *.java files?
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.
correct
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.
Tested on Windows with the java test runner: lgtm.
Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
14ff865
to
d7b98f0
Compare
What it does
How to test
Extensions
viewReview checklist
Reminder for reviewers