简体   繁体   中英

How to open a folder in VSCode without it remembering the open file editors from previous session?

I'm running into a very frustrating issue with VSCode at the moment and have tried all of the other solutions I could find out there to no avail.

Background: I'm using VSCode on MacOS. I had a relatively large (10k's of files) project open and was happily working with it, then something strange happened and something caused thousands of files to be opened and modified in VSCode, which caused it to slow down to a complete hang. I quit VSCode and attempted to reopen it to the same folder.

The problem is now every time I try to reopen it, it still attempts to reload all those thousands of files, so I can't get back into the project and have VSCode be responsive.

I've tried all the various clear cache / clear editor history / deleting folder / etc. advice I could find but nothing seems to work.

I have established that it's remembering something about the folder path, because if I rename the containing folder name I can open up the project at the new location and it has forgotten all the open editors. Conversely even if I have a completely empty folder in the original location it still attempts to open the thousands of editor files even though the files it's trying to open no longer actually exist.

So at least I have a workaround to access my files again, albeit in a different place; but I'm still stuck with a path on disk that is unusable with VSCode no matter what content is in the folder.

If anyone can advise on where the cache of previously open editor sessions for a particular folder path is stored, so that I can clear it, I'd be forever grateful!

Version information:

Version: 1.72.2
Commit: d045a5eda657f4d7b676dedbfa7aab8207f8a075
Date: 2022-10-12T22:16:30.254Z
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Darwin x64 20.6.0
Sandboxed: No

I finally figured this out: I deleted all the folders underneath ~/Library/Application Support/Code/Backups/ and after that VS Code never attempted to open the problematic files again on start up.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM