Clear workspaceStorage folder for Visual Studio Code

Viewed 7675

I do a lot of C++ development using Visual Studio Code on Windows 10. My development computer has limited hard disk capacity and Low disk space warnings are frequent.

After analysis with the excellent WinDirStat utility, %APPDATA%\Code\User\workspaceStorage was found to contain hundreds of MBs. There are dozens of random 32-character folders (eg. "9731bc4ee103e04b5a91aff76967e74b"), and each of these containing .\ms-vscode.cpptools\.BROWSE.VC.DB files which are typically >30 MB.

Can these files, or better the entire %APPDATA%\Code\User\workspaceStorage folder, be safely deleted with a batch script on Windows startup?

1 Answers

You can change the storage path of the database files. After that, I think the database files can be deleted safely.

Add this to the global settings.json file:

"C_Cpp.default.browse.databaseFilename": "${workspaceFolder}/.vscode/.BROWSE.VC.DB"

See more details here

BTW, you can also set "C_Cpp.intelliSenseCachePath" to change the IntelliSense cache path. Learn more from this issue and official docs

Related