Need Guidance on creating a custom explorer widget #14596
-
I’ve been exploring FileNavigatorContribution and FileNavigatorWidget to understand how the Explorer widget works, but I couldn’t find where the widget is added to the left panel. I installed two extensions from Open VSX (Maven for Java and Community Server Connectors), but instead of being added to the left panel, they appear as an accordion view in the Explorer widget. I’d like to understand where this is handled. If I want to create a custom widget similar to the Explorer, what would be the recommended approach for the flow to debug and understand? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hey @YathindraNikshipth, For widgets in the sidebars, Theia has a distinction between widgets and view containers. A view container can contain multiple views/widgets, and is displayed in the sidebar. The actual widget is just part of its owning view container. See here for how the navigator widget is contributed to its view container: theia/packages/navigator/src/browser/navigator-contribution.ts Lines 167 to 177 in 83fb8c1 And here how the view container is created in the first place: theia/packages/navigator/src/browser/navigator-widget-factory.ts Lines 63 to 74 in 83fb8c1 VS Code extensions can decide whether to use an existing view container and contribute their view to it, or to create their own view container. This is handled by the declaration of the view in the In order to create a custom widget. I would recommend following this guide on our website. |
Beta Was this translation helpful? Give feedback.
Hey @YathindraNikshipth,
For widgets in the sidebars, Theia has a distinction between widgets and view containers. A view container can contain multiple views/widgets, and is displayed in the sidebar. The actual widget is just part of its owning view container. See here for how the navigator widget is contributed to its view container:
theia/packages/navigator/src/browser/navigator-contribution.ts
Lines 167 to 177 in 83fb8c1