How to make VS Code retain old project folders in sidebar like sublime? - visual-studio-code

In sublime, when I drag a new folder into the editor, it gets added at the bottom of the list in the sidebar, but in VS Code, the old project is removed from the list on only the current project is active.
Is there any way to make VS Code sidebar hold the old projects as sublime did? (PS: I am new to VS Code)
Here is a comparison of Sublime sidebar and VS Code sidebar.
EDIT: I have tried the VS Code Insiders edition, The add to workspace option kind of works, but is not the exact solution of what I was looking for. Because even if you add multiple folders to the workspace, the next time you drag and drop a folder in VS Code, The workspace will get replaced with the new folder which you opened. I want that old folder to remain in the sidebar, and the newer folder to open below it like in sublime (see the image for reference).

Use Insiders version of vscode. There was introduces a feature called multi-root workspace. In nutshell: you can open multiple folders in 1 vscode window (drag-n-drop supported too).

Related

vscode own devcontainer in dropdown menu

I like to have my own devcontainer added in the dropdown menu in vscode beside the predefineds like C++.
I just copied my own .devcontainer to ~/.vscode/extensions/ms-vscode-remote.remote-containers-0.194.0/dist/node_modules/vscode-dev-containers/containers/cpp_kurs and it perfectly does what I want.
But I guess it is a little bit dirty and will be gone when the extension gets updated at least because the version number in is the folder name.
Is there a clean, good and stable way of doing this (I don't want to fork the plugin and maintain it)?

Remove subfolder from Visual Studio Code Workspace

My current workspace shows this directory. I would like to remove it so it doesn't appear in my workspace.
According to the documentation that I've read the way to do this is to go to File->Preferenceces -> Workspace Tab and the Add a pattern in the excludes.
However, no pattern that I've tried has worked.
I've tried
**/IVAPI/BKP_OLD_CODE/*
**/BKP_OLD_CODE/*
**/*BKP_OLD_CODE*
**/BKP_OLD_CODE
Then I click the refresh button on the worksapce explorer but the directory stills shows up. How can I add a patter so that BKP_OLD_CODE does not show up anymore?
You were very close, the fact is that, since its a folder, it does not have an extension or prefix! So just use the name of the folder (BKP_OLD_CODE in this case) and you are all done!

Why are sub-folders within the File Explorer in Visual Studio Code collapsing into a single line?

I am relatively new to VS Code and I think I must have accidentally changed a setting.
VS Code used to clearly display all sub-folders below and indented to the right from their parent folders, but something has changed and now my sub-folders display somewhat like breadcrumbs in the File Explorer (see image posted below).
I've tried looking through the Keyboard Shortcuts and 'Tips and Tricks' doc for VS Code as well as googling and searching through Stack Overflow, but can't seem to figure out what the command is to change this setting. Any thoughts on how to fix this would be really helpful.
This is a fairly newer change to VSCode that came on the November 2019 (version 1.41)
The setting you are looking for is "compact folders". You can get there by going to:
File → Preferences → Settings → explorer.compactFolders and then unchecking the box.
From November 2019 (Version 1.41) release notes:
Compact folders in Explorer
In the File Explorer, we now render single child folders in a compact
form. In such a form, single child folders will be compressed in a
combined tree element. Useful for Java package structures, for
example.
Setting explorer.compactFolders controls this behavior. By default,
this setting is turned on.

Cannot see folders sub folders and files in Vs

I just started using Visual Studio Code Version 1.15.1 and for some reason, after closing all the folders in the navigation explorer side bar, I cannot get it back to display the folder structure and files in the project, even after closing and reopening. The files and folders are available and I can see them fine in OSX Sierra. Also the VS code window title shows the name of the project.
You can get it back by right clicking on the sidebar "Explorer" header, and selecting "Folders". See the gif here: https://github.com/Microsoft/vscode/issues/32962#issuecomment-324866098
This has confused several people so we've decided to remove the ability to hide the "Folders" view. Continuing discussion on the general UI is here: https://github.com/Microsoft/vscode/issues/31485

Can I do this with a custom Visual Studio Code Extension?

I would like to have an additional feature in Visual Studio Code - essentially the "Scope to This" from the full Visual Studio Solution Explorer.
It is basically a context menu (right click) entry in the File Explorer of Visual Studio Code - which then should limit which files and folders are displayed.
Is such a thing possible with a Visual Studio Code Extension?
I never built an extension for VS Code before and would like to know if this is even possible or if I would just waste my time.
According to the API docs, there is no way to filter visible files in the Explorer like it can usually be done with the files.exclude setting. However, it is possible to open another folder with the workspace.openFolder complex command. This will probably also close all opened editors, and forget about the original workspace root path.
Your extension would need to remember the initial root path and opened editors to undo this "Scope to This" menu, and reopening everything every time could cause quite some lag.
You can't customize the normal explorer view.
However, you can do something like this with custom views. It allows you to create a new explorer view that can list what you want and behave as you want.
For an example implementation, check the vscode-code-outline.
If you can add a context menu entry separately too.