epsilon42
epsilon42

Reputation: 2013

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.

Upvotes: 23

Views: 7261

Answers (4)

qiz_newbie
qiz_newbie

Reputation: 427

to move existing file/folder to project root, follow this:
if there is blank space in sidebar, then drag/drop to the space (aka. background);
else, there will be a scroll bar in the right side of sidebar, then drag/drop to the scroll bar

Upvotes: 0

Jingwei Wang
Jingwei Wang

Reputation: 121

I had the same problem,too,now it's solved. Click the blank space of the project folder below all existing folders,then you'll find one blue border around the sidebar,click new foler button,it will be created in the initial folder.

Upvotes: 12

Teri Beckham
Teri Beckham

Reputation: 71

The answer from @morris S above works really well. Select any folder in the sidebar and press esc twice until you see a blue outline around the entire side bar then select the new folder icon and you will have a new folder in the root directory.

Upvotes: 3

vaske
vaske

Reputation: 9552

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 :)

Upvotes: 1

Related Questions