How can I remove folders from Visual Studio Code folder directory?

6 Answers
Just in case anyone else is looking for this - just use File > Close Folder. I think this is what the op was looking for?
Added by barlop
This no longer applies post Jan 2019, as serge's comment indicates, the option mentioned above is no longer there. Mathan's answer is the one to use now.
You might have to scroll down the file menu to see "Close Folder". 'cos sometimes the last option you see is "Close Editor", if the window isn't big enough,but scroll down and there's a few more options like "Close Folder", "Close Window", and "Exit".
And if no folder is open then "Close Folder" won't be in the option and then after "Close Editor" it goes straight to "Close Window",and "Exit". But if a folder is open then it'll be between Close Editor and Close Window.
Hi I am also facing same issue.
Here is the solution. In the Workspace Explorer, right click on the folder you wish to remove and select "Remove Folder from Workspace" from the the popup menu. See images below.
- 103
- 3
- 231
File -> Close folder doesn't work in my mac, but if I click on mac's close ( the red circle) then from the dock click on the application again, the folder is removed from the explorer.
- 101
Of course this question refers to an old vscode version and vscode now has both, "Add Folder to Workspace..." and "Remove Folder from Workspace".
But there is still at least one occasion where this question may still arise: You do not have this option on subdirectories of an added folder. So you have to do "Remove Folder from Workspace" on the right folder and add subdirectories you want to keep afterwards.
- 101
- 1
Code is doing exactly what it is intended to do here.
The Working Files section lists the files you have either opened via a double-click in the Explorer pane or have opened another way and then edited. (See the docs.)
The HTDOCS folder you've also circled is the folder you explicitly opened via File → Open, so of course that shows up.
The Explore view is clearly a reference to Windows Explorer, which just shows you the contents of the folder you have open. It is a live view: say mkdir foo at the command line in the directory you have opened in Code, and a second or so later, foo will appear in the Explore pane, if you have the folder's disclosure triangle twirled open. Just as Windows Explorer simply shows you what's present in the folder you have opened in it, so does Code Explorer.
I have found that the Explore pane doesn't pay attention to the OS's "hidden" file attribute. It also doesn't ignore dot files. But, this is the sort of thing you expect for a 0.1.0 product. I have filed a bug for this issue; please vote on it if you care about this.
- 3,835


