VS Code Explorer is not showing any project directory or files - visual-studio-code

I have this one project for which VS Code is not showing any files or directories in the Explorer tree
The actual project files and directories at the root are these:
VS Code is working fine for other projects.
How can I fix this?

Another solution: Go to Settings and check "Files: Exclude" in both "User Settings" and "Workspace Settings". Delete the files/folders needed to appear.

Try removing the folders inside ~/Library/Application Support/Code/ (except the User/ folder because that contains your keybindings and settings configurations) and then restart Code.

I had that same problem today (Version: 1.61.0) and fixed it by:
Opening ("Open...") another project on which folders WERE shown.
Opening the original project right after by selecting ("Open..."), but NOT "Open Recent".

This happened to me a while ago and it took me over a month to realize what was happening. In my case, for some reason I added the glob pattern "**/*" for the property Files: Exclude. Basically, I told vscode to exlude all the files in the project, just remove the pattern and you should be fine. I hope someone finds this useful.

The easiest way it worked for me was to drag the folders from Windows Explorer into VS Code. That restored the entire directory tree for me.

I was stuck on this for a while but I figured out it was a permissions error. Run ls in the terminal to see if you have the same error as me, if you do it should tell you permission denied.
The fix is very easy:
sudo bash
chmod 775 .

I was facing the same problem. I reinstalled the vscode and it worked for me.

Restarting VS Code was enough for me to get it working.

create a folder using terminal with command "mkdir folder-name" then go to "file" in menu and then to "open folder" then select the folder u used while creating mkdir. This woked for me.

go to the directory you want then press right click and press open with then select vs code

Related

VSCode: Searching into all project content

Since VSCode version 1.31 I can't find anything into my project files. I've already reinstalled the VSCode App on my Mac, but nothing happened on it.
This option doesn't work without open the files before:
https://code.visualstudio.com/docs/editor/codebasics#_search-across-files
I've been searching on the web, but I didn't find anyone with the same problem as me.
Please, help me!!
To make all your files visible in search you must always make sure all the necessary files are present in the same director. And then as Renee stated in the comments above, you should add your working folder to the Workspace or open folder from the start screen. Below are the screen snippets of the Visual Studio code's start screen from where you can file Add Workspace Folder button. If it is not found, you can always find it under File menu.

How can I cleanly remove Workspaces in Visual Studio Code?

I'm on a MAC and remove workspaces with the terminal in the folder ~/Library/Application Support/Code/User/workspaceStorage, but i don't think it's the clean way.
Can someone explain me how I can remove cleanly a workspace and all its files from my mac?
I miss this feature. I can add many workspaces, but where is the "delete button"?
I use Visual Studio Code V.1.28.2 on macOS Mojave 10.14.
You can use the command palette:
Menu: View > Command Palette... (or F1)
Search: "Workspaces: Remove Folder from Workspace..." and select the folder you want to remove.
Hope this may help you
Visual Studio Code 1.32.3. Windows 10.
Here's the answer from the Twitter account of Visual studio code:
You have just to go to the Explorer section and remove any folder or file in it see the image below:
right click in the workspace you'd like to remove and select the "Remove Folder from Workspace" item; the name of the workspace will become: "NO FOLDER OPENED" that is the one you'll get when you installed the very first time Visual Studio Code.
If none of the above solutions works ...you can go to file -> close folder.
It will close the workspace folder and you can add any new folder to the explorer, like the first time you install visual code
find workspace.json, it will be inside the workspace you had created workspaces->[unique number]->workspace.json . you can edit the workspace directories in it.
The only other relevant answer is this .
The Workspaces is stored at %userprofile%\AppData\Roaming\Code\User\workspaceStorage (Windows) , none of the mentioned actions will delete them .
There also can be a .code-workspace Workspace File or "Workspace Config", which can be moved anywhere . And .vscode Workspace Folder/-s in the folder/-s which was added to the workspace .
Deleting all existing of these 3, and the relevant items from : %userprofile%\AppData\Roaming\Code\storage.json and all %userprofile%\AppData\Roaming\logs<< .. >> . Will be a workspace deletion .
It seems that workspaces are either open or closed, you can close them from the main menu. To cleanly delete a workspace, just remove the workspace file from disk also.

Visual studio code, exclude directory from "go to file" option (ctrl + p)

I am using vscode, and I would like to exclude some directories (with webpack bundles) from 'go to file' option in vscode.
I tried to exclude them by "search.exclude" and "files.exclude". That worked in files tree and in search, but I still can find these files by 'go to file'.
Do you know how to do this?
As #adamesque stated, to exclude files from quick open you can either add them to files.exclude or search.exclude setting.
The issue then is that Quick Open also stores recent items, even from excluded paths.
Fortunately, VSCode now have a command File: Clear Recently Opened!
EDIT: As I needed to replace a Disk path while keeping my recent files I found where they are stored. It's in the storage.json file which is under /Users/imac/Library/Application Support/Code/storage.json on macOS and AppData\Roaming\Code\storage.json on Windows.
I thought I had this exact problem, and all the relevant issues I could find in the VS Code GitHub project seemed to have been fixed (see https://github.com/Microsoft/vscode/issues/19029, https://github.com/Microsoft/vscode/issues/6502).
In my case, because I had previously opened some of the files in those excluded directories, they still showed up in "Go To File" in the "Recently Opened" section, which made me think the exclusion feature wasn't working.
Turns out I just had to manually remove those items from history to keep them from showing up. Open the Command Palette, run Remove from History, and then select the a file to remove. You may need to do this for each file you'd previously opened from an "excluded" dir, but after this is done, they shouldn't show up anymore in the "Go to File" menu.
Hope this helps!
Version 1.44:
now we have an option in the settings.
If you tipe "Goto file" in the setting search bar, the editor opens up a Search:Exclude section, and you can add a folder or files.
CTRL + SHIFT + P, then select File: Clear Recently Opened

Open multiple Projects/Folders in Visual Studio Code

How do I open multiple projects/folders in a single Visual Studio Code instance, and open multiple files in single view? Does it has any option for future change request?
Not sure why the simplest solution is not mentioned. You can simply do File>New Window and open the other project in the new window.
Update
This is now available out of the box as of October 2017. From the blog post:
This was our #1 feature request - it's been a while coming but it's here now.
The complete documentation is here.
You can work with multiple project folders in Visual Studio Code with multi-root workspaces. This can be very helpful when you are working on several related projects at one time. For example, you might have a repository with a product's documentation which you like to keep current when you update the product source code.
Original answer
Currently the Insider channel of VSCode gives us this out of the box.
Read more from the blog post.
Update
As mentioned in several other answers here, this 'accepted' answer is outdated and is no longer correct. VS Code now has the concept of a 'workspace' which lets you add several 'root' folders to VS Code in the same window.
For instance, when working on a project in one folder that utilizes shared code held in a different folder, you can now open both the project folder and the shared folder in the same window.
To do this you use the Add folder to Workspace... command. VS Code then saves this configuration in a new file with a .code-workspace extension. If you double-click that file, VS Code will re-open with both folders present.
Original Accepted Answer (Outdated)
As described in The Basics of Visual Studio Code article:
"VSCode is file and folder based - you can get started immediately by opening a file or folder in VSCode."
This means the concept of solution and project files, like the .sln and .csproj, have no real function in VSCode other than that it uses these only to target and identify which language to support for Intellisense and such.
Simply put, the folder you open is the root you work with. But of course there is nothing from stopping you to open multiple windows.
As for the request features options, navigate to Help > Request Features which will redirect you to the UserVoice page of VSCode.
Support for multi-root workspaces is now enabled by default in the latest stable release [November 2017 release].
The File > Add Folder to Workspace command brings up an Open Folder dialog to select the new folder.
If you are using unix like OS, you can create a soft link to your target folder.
E.g. I want to see golang source while I am using VSCode. So, I create a soft link to go/src under my project folder.
ln -s /usr/local/go/src gosrc
Hope this helps!
Update: 11/28, 2017
Multi Root Workspaces[0] landed in the stable build, finally.
https://code.visualstudio.com/updates/v1_18#_support-for-multi-root-workspaces
[0] https://github.com/Microsoft/vscode/issues/396
You can open any folder, so if your projects are in the same tree, just open the folder beneath them.
Otherwise you can open 2 instances of Code as another option
On Windows it's possible to use mklink to create directory symbolic links to the needed folders. Then keep them together in a folder, and VSCode will list the content of these.
c:\>mklink /D c:\dev\MyWork\scripts c:\ProjA\scripts
symbolic link created for c:\dev\MyWork\scripts <<===>> c:\ProjA\scripts
c:\>mklink /D c:\dev\MyWork\styles c:\ProjB\styles
symbolic link created for c:\dev\MyWork\styles <<===>> c:\dev\ProjB\styles
This is very similar to #NeilShen's idea, I guess.
Multiple Folders in VS
Click ->File ->Add Folder to Workplace.
Step 1.
Choose which project to work ->Add(press)
Step 2.
October 2017 (version 1.18):
Support for multi-root workspaces is now enabled by default in the Stable release: https://code.visualstudio.com/updates/v1_18#_support-for-multi-root-workspaces
Now we can open multiple folders in one instance, Visual studio code has named as Workspace ("Area de Trabajo"). Take a look at the images, it´s very simple.
Or you can just select multiple folders and then click open.
Go to File> Open Folder, then select multiple folders you want to open and click Select Folder
Just put your projects in the same folder and simply open that folder in vscode.
Now your projects will appear like:
GROUP OF PROJECTS
PROJECT 1
Contents
Contents
PROJECT 2
Contents
Contents
It's not possible to open a new instance of Visual Studio Code normally, neither it works if you open the new one as Administrator.
Solution: simply right click on VS Code .exe file, and click "New Window"
you can open as many new windows as you want. :)
You can install the Open Folder Context Menus for VS Code extension from Chris Dias
https://marketplace.visualstudio.com/items?itemName=chrisdias.vscode-opennewinstance
Restart Visual Studio Code
Right click a folder and select "Open New Workbench Here"
Open New Workbench Here
You can open up to 3 files in the same view by pressing [CTRL] + [^]
What I suggest for now is to create symlinks in a folder, since VSCode isn't supporting that feature.
First, make a folder called whatever you'd like it to be.
$ mkdir random_project_folder
$ cd random_project_folder
$ ln -s /path/to/folder1/you/want/to/open folder1
$ ln -s /path/to/folder2/you/want/to/open folder2
$ ln -s /path/to/folder3/you/want/to/open folder3
$ code .
And you'll see your folders in the same VSCode window.
you can create a workspace and put folders in that :
File > save workspace as
and drag and drop your folders in saved workspace
You can use this extension known as Project Manager
In this the projects are saved in a file projects.json, just save the project and by pressing Shift + Alt + P you can see the list of all your saved projects, from there you can easily switch your projects.
To run one project at a time in same solution
Open Solution explorer window -> Open Solution for Project -> Right click on it -> Select Properties from drop down list (Alt+Enter)-> Common Properties -> select Startup Project you will see "current selection,single selection and multiple selection from that select "Current Selection" this will help you to run one project at a time in same solution workspace having different coding.
You can simply add folders (as many you want) in your workspace as shown in this image:
Image
And use them unhesitatingly.

Retrieve/Recover deleted Netbeans project

I was just working on my Netbeans project and accidentally deleted it and don't know how to recover it.
Is there a tmp folder that the deleted project is stored in.
Or am I forever doomed?
Thanks,
Lucas
Do not panic. Its very easy. Follow the steps:
Right click on the folder/directory that the files had been deleted.
Choose Local History – Restore Deleted
Done
If you accidentally delete a folder on Netbean, the way to recover it is as follows. You can't revert deleted folders but you can revert deleted files. Follow these steps.
Recreate the folder you deleted in your Netbean project. (You may not be able to create the folder within Netbean, in that case you can use mkdir command to create the folder )
Right click that folder in Netbeans and go to History -> revert deleted (you should see a list of deleted files that relate to that particular folder.
Repeat for each folder and sub-folder
Note: I do not know if this works on windows, I know it worked for me on Linux. I also don't know if this works after you have closed Netbeans.
hope it helps someone.
You have a problem of package/directory/file deleted in netbeans?
Don't panic it is simple just:
open your netbeans IDE
go to projects
go to the package where your project folder was
right click on it
go to local history, then go to revert deleted
it is done. Wait a moment!
I think it will help you.
Enjoy your code please.
http://www.recuva.com/
saved me countless times when I first started with Visual C# opening the IDE and making mini programs without saving. All your files are stored in a temporary folder and exiting Visual C# wipes them. Just do a recuva scan and sort files found by modification time. Deleted files are recoverable, overwritten files however are a different story, so run the program as soon as possible.
Actually, easier then trying to load a project that does not exist in the project explorer of netbeans.
If you still have the files locally, just choose Open Project and your lost project will be restored to the Project explorer of netbeans.
I don't know if there is a temp folder. Windows search engine doesn't work to find it. If you delete the source file by using safely delete;
On Netbeans Refactor-Undo[Safely Delete] option can be used to recover...