-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Icons for TreeViewItems fallbacking to default folder item if file uri is used. #43216
Comments
@Krzysztof-Cieslak Yes, I was assuming all resources with children as folders which is true in File explorer but not in custom views. So we need a convention to determine if a resource URI is a directory/folder or not. One convention is to have a trailing slash to indicate if URI is for folder/directory or not. |
Couldn't we just check whether URI points towards folder or file with FileSystem API? Or that would be too slow? |
I do not think that is a good idea, because some of the URIs could be pointing to remote locations and it will make tree much slower. |
I need to check a few things before reopening my pr but what i did essentially was to keep the current behavior by default and allow extension developers to be explicit about folder/file |
The FileKind was previously guessed from the collapsability of the item, extensions now have the capability to set it manually. Fixes microsoft#43216
To verify:
|
Example:
As far as I understand this line is a problem - https://github.com/Microsoft/vscode/blob/5755810a58ac76ffedb037647f1cd6fec406efe9/src/vs/workbench/browser/parts/views/treeView.ts#L334
If an item has Expended or Collapsed state (which basically means it's an item with childs) then we expect folder icon.
In general, I don't think we should have such convention at all, and consumers should be able to set any icon they want - in case of my extension, tree view shows some information from the file, so it makes sense for me to use file icon on the node with child elements.
CC: @sandy081
The text was updated successfully, but these errors were encountered: