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

TreeItem does not display folder theme icon #146479

Closed
daviddossett opened this issue Mar 31, 2022 · 6 comments
Closed

TreeItem does not display folder theme icon #146479

daviddossett opened this issue Mar 31, 2022 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders tree-views Extension tree view issues verified Verification succeeded
Milestone

Comments

@daviddossett
Copy link
Contributor

It looks like specifying folder in the icon path does not render the icon in a TreeItem:

this.iconPath = new ThemeIcon("folder");
CleanShot 2022-03-31 at 15 15 35@2x

I was able to work around this with an alias pointing to the same icon for now:

this.iconPath = new ThemeIcon("file-directory");
CleanShot 2022-03-31 at 15 05 17@2x

@miguelsolorio
Copy link
Contributor

@joaomoreno I talked to @aeschli about this and it appears like this is a bug on tree view for specifying folders:

In resource trees, folder refers to the folder icon from the current file icon theme.
But if the file icon theme has no folder icon, it should fall back to the codicon folder icon.

@joaomoreno joaomoreno assigned alexr00 and unassigned joaomoreno Apr 1, 2022
@alexr00 alexr00 added bug Issue identified by VS Code Team member as probable bug tree-views Extension tree view issues labels Apr 1, 2022
@alexr00 alexr00 added this to the April 2022 milestone Apr 1, 2022
@alexr00
Copy link
Member

alexr00 commented Apr 1, 2022

If the tree item represents a resource then we should still respect the file icon theme's choice about whether to show a folder icon.

However, for non-resources, we should show the folder icon.

@alexr00 alexr00 closed this as completed in d79928b Apr 1, 2022
@daviddossett
Copy link
Contributor Author

Thanks for fixing @alexr00!

@daviddossett daviddossett reopened this Apr 1, 2022
@alexr00 alexr00 added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Apr 1, 2022
alexr00 added a commit that referenced this issue Apr 4, 2022
@JacksonKearl
Copy link
Contributor

Verified?
image

Looks like the theme's folder icon is not getting used when treeItem.iconPath = new vscode.ThemeIcon("folder"); is set for a non resource tree view item, instead falling back to the generic codicon. Not sure if this is intended.

@JacksonKearl JacksonKearl added the verified Verification succeeded label Apr 28, 2022
@alexr00
Copy link
Member

alexr00 commented Apr 29, 2022

Yes, that's intended. Thank you for verifying!

@github-actions github-actions bot locked and limited conversation to collaborators May 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders tree-views Extension tree view issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

7 participants
@joaomoreno @JacksonKearl @daviddossett @meganrogge @miguelsolorio @alexr00 and others