Visual Studio Code: How to create menu in view container - visual-studio-code

I'm creating an extension in Visual Studio Code, and I'd like to know how to create a menu in my custom view container. For example, the Git Source Control extension allows you to have two folders open and click on which one to operate before performing the usual Git operations. I want to know how it is possible to create this view, and how to dynamically alter it (i.e., add/remove folders).

Related

vscode extension CustomTextEditor Drag'n Drop

I want to drop TreeViewItem into my CustomEditor.
I've implemented a DocumentDropEditProvider that is working well for a "normal" text editor.
But I don't know how to make it work on my CustomTextEditor or its webView.
I couldn't find anything in the documentation.
I've cloned the vscode and run it in debug mode and I don't see any place where a Drag and Drop Listener would have been registered for the CustomTextEditor (besides the one that handles the shift key/editor open).
Is it something that one can do or should I look into using webView instead of treeView to have a better control of Drag and Drop listener ?

Is it possible to show the `Explorer` tree in a different view in VSCode?

Suppose I have a custom view in VSCode (which already has some tree views), is it possible to show the Explorer (workbench.explorer.fileView) tree in it?

Visual Studio Code - Drag Explorer Feature

My request to VSCODE repo was dropped, but I still want to add it, even if I don't know how to do it by my self
Drag the heck explorer to the bottom panel, same as search or source control
Any idea of how to do it? can be possible creating an extension?
dropped issue: https://github.com/microsoft/vscode/issues/108252
right click beside search and check explorer

What is that component on the top-right of VS Code called? How can I change the setting of it?

I'm using VS Code on Mac and I was curious about one component.
Every time I open a new python file, this component will show up on the top right of the current window? But I can't find the name of it.
That's not just "one component", but actually multiple buttons added to the editor actions toolbar from multiple extensions installed on your VS Code.
In order from left to right:
Open Changes (built-in with VS Code as part of their Version Control functions)
Run Python File in Terminal (added by Microsoft's own Python extension)
Open Changes in previous revision (added by the GitLens extension)
Show Revision Details (added by the GitLens extension)
Open Changes in next revision (added by the GitLens extension)
Toggle File Blame Annotations (added by the GitLens extension)
Split Editor (built-in with VS Code)
For GitLens, they are automatically added when it detects the currently opened file is part of a git repository. You can configure them by accessing the command palette (CMD+Shift+P on a Mac), then entering "GitLens: Open Settings". Find the "Menus & Toolbars" section:
For example, if you want to remove buttons 3., 4., and 5., uncheck "Add commands to the editor group toolbar" > "Add comparison commands". Then reload VS Code. You can configure all the other settings there.
For the green Play button, it automatically appears when you the currently active file is a Python file. AFAIK, there is no way to configure or hide/remove it other than disabling the Python extension completely (which you certainly don't want to do). There are requests on VS Code's Github page to hide it, like this: Add setting to disable icon for "Run Python File In Terminal".
For the "Open Changes" and "Split Editor" buttons, AFAIK there is no built-in way to hide/remove them. You can only control the behavior from the VS Code settings:
As mentioned in the comments, there is a feature request for VS Code to Allow hiding the buttons in the tab bar line and in the panel title bar, which includes the "Open Changes" and "Split Editor" buttons. There are users who provided workarounds at hiding the buttons using extensions. You may want to follow that thread and/or try out some of those extensions.

How to add a new menu item to the File menu in Visual Studio Code?

Is it possible to create an add a custom menu to the main menu bar (preferably the File menu) in Visual Studio with an extension? I want to add a new project type.
Related question as this but for Visual Studio Code instead of Visual Studio:
Adding a Menu to the Visual Studio Menu Bar within an Add-In
I've been looking for the same thing, but currently, I don't think it's possible. This link describes how an extension can create menu items, but the only "contribution points" are in context menus. There is no contribution point for the top-level File menu. I have also been unsuccessful finding a configuration file for editing the existing menus.
Additionally, this other SO post seems to confirm this: VSCode: hiding some default menu items
opened https://github.com/microsoft/vscode/issues/74013