You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow tree views to use icons for symbol kinds on their nodes #45057
To display icons in explorer trees we can either pass a path or use resourceUri, there's no way to re-use icons used elsewhere in code for symbol types (for example in the workspace symbol searches).
Johannes Rieken (@jrieken) That sounds good - though in this case this is a specialised tree and not the normal symbol view of my document (it's a sort of render tree we build from static analysis to help the user visualise their UI). With #5606 will it be possible to have a custom tree that can render in a similar way (eg. both a stanadard symbol tree and this custom tree)?
Here's an example of the tree in IntelliJ. The items are not all symbols defined in the document, but in many cases constructor invocations that would create a widget (for ex. MaterialApp inside build is a new MaterialApp(...) call).
With #5606 will it be possible to have a custom tree that can render in a similar way (eg. both a stanadard symbol tree and this custom tree)?
Yeah, should be possible... The idea is to extend the DocumentSymbelProvider so that it can return hierarchical data. However, the idea is also to allow for different representations of that data, e.g. a break-crumb and/or a tree. Also likely that the tree will sit where the minimap sits.
What you are trying to achieve seems a little further away from "normal" outline, tho there is no normal outline...
Johannes Rieken (@jrieken) Yeah, I understand our need is somewhat unusual. Using the DocumentSymbolProvider for this would feel a bit weird since it's not semantically the same.
Another possible option might be to provide us with a way to get the Uri for a Uri fo built-in icons that we could provide to the existing explorer tree? That would be fairly generic/reusable and probably relatively simple to implement?
I don't know if this answers the question but there's an enum named SymbolKind which is used in the SymbolInformation types returned by the symbol providers. My need is to be able to display an icon for one of them in the contributed tree.
Is it likely there may be any progress on this in the near future? I'm currently thinking about just taking a copy of the icons from here and periodically updating them. It doesn't feel like an ideal solution, but users have been asking for a Flutter Outline for well over a year and I'd really like to deliver something.
I tried many times to use the built-in outline, but it does not support being extended as required here and I was guided towards a custom tree. Specifically, it does not have:
I'm also not sure it has selected events, which I'd also need to set contexts correctly so my context menus can work.
I've got prototypes going both ways, but neither are great. I would prefer to extend the built-in outline, but more requests have been rejected for supporting that than the custom tree, so I figure it has to be this way.
Activity
jrieken commentedon Mar 5, 2018
Closing this in favour of #5605 which is something we will do within the next 2 or 3 milestones
DanTup commentedon Mar 5, 2018
Johannes Rieken (@jrieken) That sounds good - though in this case this is a specialised tree and not the normal symbol view of my document (it's a sort of render tree we build from static analysis to help the user visualise their UI). With #5606 will it be possible to have a custom tree that can render in a similar way (eg. both a stanadard symbol tree and this custom tree)?
DanTup commentedon Mar 5, 2018
Here's an example of the tree in IntelliJ. The items are not all symbols defined in the document, but in many cases constructor invocations that would create a widget (for ex. MaterialApp inside
buildis anew MaterialApp(...)call).jrieken commentedon Mar 5, 2018
Yeah, should be possible... The idea is to extend the DocumentSymbelProvider so that it can return hierarchical data. However, the idea is also to allow for different representations of that data, e.g. a break-crumb and/or a tree. Also likely that the tree will sit where the minimap sits.
What you are trying to achieve seems a little further away from "normal" outline, tho there is no normal outline...
DanTup commentedon Mar 5, 2018
Johannes Rieken (@jrieken) Yeah, I understand our need is somewhat unusual. Using the DocumentSymbolProvider for this would feel a bit weird since it's not semantically the same.
Another possible option might be to provide us with a way to get the
Urifor aUrifo built-in icons that we could provide to the existing explorer tree? That would be fairly generic/reusable and probably relatively simple to implement?jrieken commentedon Mar 6, 2018
cc Sandeep Somavarapu (@sandy081) who is doing some work on icons
sandy081 commentedon Mar 6, 2018
Last milestone we introduced constants to represent themed folder or file icons. May be this can be done using similar approach?
Johannes Rieken (@jrieken) Are there constants in the API representing document symbol icons?
DanTup commentedon Mar 8, 2018
I don't know if this answers the question but there's an enum named
SymbolKindwhich is used in theSymbolInformationtypes returned by the symbol providers. My need is to be able to display an icon for one of them in the contributed tree.sandy081 commentedon Mar 12, 2018
Danny Tuppeny (@DanTup) Thanks.
Johannes Rieken (@jrieken) How about extending
iconPathto takeSymbolKindconstant in addition ?4 remaining items
sandy081 commentedon Mar 12, 2018
Ok, Makes sense.
axetroy commentedon Mar 18, 2018
agree.
DanTup commentedon Jul 11, 2019
Is it likely there may be any progress on this in the near future? I'm currently thinking about just taking a copy of the icons from here and periodically updating them. It doesn't feel like an ideal solution, but users have been asking for a Flutter Outline for well over a year and I'd really like to deliver something.
sandy081 commentedon Jul 12, 2019
No progress.. also given that outline view is provided out of the box, not sure if it is needed for other extensions.
DanTup commentedon Jul 12, 2019
I tried many times to use the built-in outline, but it does not support being extended as required here and I was guided towards a custom tree. Specifically, it does not have:
<function>#51332 (comment)).I'm also not sure it has selected events, which I'd also need to set contexts correctly so my context menus can work.
I've got prototypes going both ways, but neither are great. I would prefer to extend the built-in outline, but more requests have been rejected for supporting that than the custom tree, so I figure it has to be this way.
aeschli commentedon Oct 9, 2019
The request to use the VSCode icons in extensions is #31466
DanTup commentedon Oct 9, 2019
Yeah, this is a dupe of that. Like everyone else, I've just copied all the icons from VS Code into my project 😞