Visual Studio Code deleted files after crash - visual-studio-code

Visual Studio Code has crashed and deleted all files and all file changes I've been working on for the last 5 days, although I've saved them. Is there any solution for recovery ...

If you are using Windows, your Visual Studio code files can be found at %appdata%/Code/Backups
If you are using MacOS, then you can find all your Visual Studio code files at
$HOME/Library/Application Support/Code/Backups

Same problem for me. The entire vs-code folder is empty!
I searched the recycle bin, vs-code backup folders, recovery tools for deleted files but found nothing.
Thanks to the message below, I found a copy of the code in the folder:
%appdata%/Code/User/History

Related

workbench.js is removed in Visual studio code version 1.70.0

I notice that since version 1.70.0, VSCode has removed %localappdata%\Programs\Microsoft VS Code\resources\app\out\vs\code\electron-browser\workbench folder.
Hence it broke extensions that rely on the file workbench.js in this folder.
Is there any workaround for this problem or the extensions need to be re-written?
these files have moved to
resources\app\out\vs\code\electron-sandbox\workbench

Terminal Git Status showing different than Visual Studio status

I've been at this for a couple of days and I can't figure this out.
When I run git status on my terminal, it's giving me a different result than what my visual studio 2022 shows me. I think this all started when i added git lfs to my repo using brew so it doesnt track the larger files i have.
For example, in my terminal, it's showing: . Usually they show the same files always and never have an issue.
but then on the same branch in visual studio 2022, it's showing, it's showing this:
so far, I've tried:
Restarting my computer and visual studio(I had to try)
Using the sync button (next to the pushbutton) in visual studio.
Running git remote update on my terminal
I can't find anything else on SO to try.
Any and all help or direction is appreciated!
Check your .gitattributes files; since you added git lfs, it tracks the large file extensions with the .gitattributes file. That may be the reason why Visual Studio is not tracking those files, but your git terminal does.
There is a bug which i also face in visual studio.
Sometimes the VSCode cannot track the files which are updated.
what you can try is update the visual studio to see if the bug is fixed or not.
Mine was resolved by updating the VS.
PS: try using GitLens for a broader view of git.

Unable to find the TF executable while adding tfs to VSCode

I am adding TFS to Visual Studio Code IDE(1.42.0) for that I have installed Azure Repos extension.
In VS code at File-->Preference-->Setting-->Tfvc:Location, when I am entering path C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\tf.exe.
Getting error
(team) Unable to find the TF executable. Please ensure TF is installed
and the path specified contains the filename.
How can I solve this issue?
Edit 1: After installing Azure Repos extension, I am entering above path in tfvc:Location(for both tabs User and Workspace), but after entering path nothing happens. Check below screenshot
Edit2: Now I am getting this error at right below in VS code IDE
Since you have not got any help yet. I will take a shot. Any chance there is a issue with finding the executable and casing for the extension? My local TF is capitilized. \TF.exe
Also might want to checkout the Github and readme for TFVC.
Make sure you have installed VS on your computer. With a typical installation of Visual Studio, the Windows version of the TFVC command line client (tf.exe) is available under the Program Files (x86) folder. It will typically be placed in a location similar to C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\TF.exe. On the 2017 version of Visual Studio Community, it can be found in a location similar to C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\TF.exe.
I found a .vscode folder in my project
delete it, close and reopen vscode solved the problem

How to Change VS Code Code.exe Path for Update?

[Windows 10] I have "Microsoft VS Code (User Setup)" installed in a custom directory and whenever I try to update it this shows up:
and then this
Log Info
Dec 23 11:42:40.673 INFO Starting: C:\Users\jeremy\AppData\Local\Programs\Microsoft VS Code\Code.exe, false
Dec 23 11:42:40.674 ERRO Bad arguments: Code path doesn't seem to exist: C:\Users\jeremy\AppData\Local\Programs\Microsoft VS Code\Code.exe
How do I change the path to point it to the right directory where "Code.exe" exists?
I had the same problem recently. I ended up reinstalling VS Code.
Do I lose my settings?
No. Note that I did not uninstall VS Code, I just downloaded the installer from the website and installed VSCode. This won't hurt, as it does not touch your settings and extensions.
What I tried
I first tried to visit the path mentioned in the error log, and I noticed that the folder _ within that directory contained the new VS Code version, downloaded by the updater.
So the path should have been C:\Users\myusername\AppData\Local\Programs\Microsoft VS Code\_\Code.exe instead, perhaps.
I tried to move all files from _ to their parent directory, and then, in VS Code, Help ยป Restart to update. This opened the new version of VS Code, but after closing it and starting it from the original install location (or through a shortcut I have always been using), the old version was still loaded. So apparently, this "trick" didn't work.
Then I tried to make a symbolic link to Code.exe within the _ directory, so the VS Code updater would find Code.exe. This caused roughly the same things to happen. So, this didn't work either.
At last, I decided to just download VS Code from their website, and simply install it. This seemed the most simple option to me.
Create a hard link for Code.exe using mklink, works for me.
Command should look like this (depends where your custom installation is, my in C:/Program Files/Microsoft VS Code/):
mklink /H "C:/Users/$username/AppData/Local/Programs/Microsoft VS Code/Code.exe" "C:/Program Files/Microsoft VS Code/Code.exe"

Visual Studio Code Permanently Deletes Files

Deleting a file from within Visual Studio Code permanently deletes the file, instead of sending it to the recycle bin. Why is that?
With the 0.5.0 release of VS Code files and folders deleted from the explorer will be moved to the OS trash from where you can also restore them.