Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drag and drop/creating new folder in project root folder in Visual Studio Code

I've opened a folder in VS Code and I wish to create a subfolder using the buttons that appear alongside the folder name in the sidebar or by using the right click context menu.

When using either of those options, it creates a folder in one of the subfolders instead, not the initial folder I opened.

The only way I can make it create a folder in the project root is by selecting the 'empty space' in the sidebar and then pressing the create folder button. The problem with this is that if there are many items in the sidebar then there is no empty space to click on.

Have I completely overlooked something trivial here?

enter image description here

E.g. In the .gif I want to create a new folder under the folder named + (plus sign - sorry for weird folder name)

EDIT: Have updated the title to mention another related issue with drag and drop to the root folder using the sidebar when the root folder has no files in it or if there is no empty space in the sidebar.

Also, here's a partial solution/workaround for creating a new file/folder in root folder using sidebar:
Select any folder in the sidebar and press ESC twice until a border appears around the sidebar, you can then create a file/folder and it will appear in the root. Only a partial solution because it doesn't help with the drag/drop to root folder issue that I've recently noticed.

like image 514
epsilon42 Avatar asked Jan 22 '18 15:01

epsilon42


People also ask

How do I create a root directory in VS Code?

Adding folders#The File > Add Folder to Workspace command brings up an Open Folder dialog to select the new folder. Once a root folder is added, the Explorer will show the new folder as a root in the File Explorer. You can right-click on any of the root folders and use the context menu to add or remove folders.

How do I add a File to the root directory in Visual Studio?

Select any folder in the sidebar and press ESC twice until a border appears around the sidebar, you can then create a file/folder and it will appear in the root.


1 Answers

Basically you can select any file in root and then press on add new button it will add new directory on same level as root file, in root :)

like image 105
vaske Avatar answered Oct 08 '22 21:10

vaske