.vscode caching too much data since update
I have noticed since the recent update that cpptools seems to be caching a lot of data (~1GB for a small project). This seems to be in an ".vscode/ipch" subdirectory.

@kckemper Yes, that is the bug we fixed (#3368 ). We plan to ship a fix for that next week.
Great! That'll help.
@kckemper The latest extension Insiders has fixed the ~/.vscode bug with the intelliSenseCachePath: https://github.com/Microsoft/vscode-cpptools/releases/tag/0.22.2-insiders .
Well, commiting .vscode is not the only issue here. You see, i save my documents, workspace etc., in the cloud, in services like MEGA. When this .vscode grows to GB it takes away my quota in these services. So yes, IT IS a pain. I understand you justifying/defending the feature, but to say it is not a pain, like if you have analysed all possible scenarios, is "a little arrogant", to say the least. And even if this was not the case, the feature is creating files that can be several orders of magnitude bigger than the files in the project. This can not be right...
@RafaelQuirino You can change your intelliSenseCachePath setting though so it's not taking up quota in cloud services, right?
VSCode's default for the cache path works fine for me. The only issue was not knowing what stuff was in there, and whether to commit it to source control. (I have since added ".vscode/ipch" to my .gitignore file, and deleted files that were committed before I knew what they were. That works for me.)
How about creating a ReadMe file inside .vscode/ipch to explain what's being stored there, that it's OK not to commit it to source control, and what settings you can change to modify the location and size of the cache?
Another case: I have source code in a directory on Dropbox, purely for reference, not for editing/development. Now I discover that these ipch files have been synched to everyone in the company, with little or no benefit to them.
@pedro-w Can you change your intelliSenseCachePath to a different location and/or delete those files from Dropbox?
@sean-mcmanus Yes I can, and I've done both those things now, thanks. I just wanted to make the point that it's not purely a problem for source control users, so modifying .gitignore is not a solution for everyone.
Any reason why the discussion is not about having the "C_Cpp.intelliSenseCacheSize": 0 as default, and then the user can decide whether he wants to use the Intellisense and how? VScode is supposed to be a text editor that can have expanded functionality, not an almost-IDE that can be turned into a text-editor by changing the settings back to zero after checking the issue in github and finding what exactly is that ipch folder that the extension creates automatically by simply having a file opened.
Could you use the same folder path to storage cpptools database and ipch file?
such as : User\workspaceStorage\461a22b28b7917e54e4c47c056e86663\ms-vscode.cpptools User\workspaceStorage\461a22b28b7917e54e4c47c056e86663\ipch
If I can set workspaceStorage path, it will be better.
Copying comment from #3664 here for all followers of this issue to see:
Proposed changes to default path of IntelliSense cache path
We propose using the user directory as the new default IntelliSense cache path (see proposed new default path below). The proposed solution will, by default, reduce the disk space usage and alleviate implications on source control for users who have not configured the cache.
As part of this proposed change, the extension will also automatically remove any caches previously added to the ${workspaceFolder}/.vscode folder when the old default behavior was applied.
Disk Space By using the user directory as the default path, it will create one cache location per user for the extension instead of creating a cache per workspace. As the cache size limit is applied to a cache location, having one cache location will also reduce the disk space usage of the cache for everyone using the default setting value.
Source Control Moving away from the workspace folder to the user directory as the default path will also address the concerns of the cache implications on source control for the workspace folder for everyone using the default path.
New default path
The new default path for C_Cpp.intelliSenseCachePath setting will be the following:
On Windows
%USERPROFILE%/.cpptools
On Linux and Mac
~/.cpptools
Please provide us with your feedback on this proposal.
Would it be possible to use an already existing, Code related, path?
On Windows, the path for most of the settings and some cached data is %APPDATA%/Code and would be a better choice (saving stuff directly in %USERPROFILE% is not IMHO very Windows-like).
For Linux (and I suppose Mac) we already have the .config/Code and .vscode directories.
Our extension doesn't own the %APPDATA%/Code folder so it wouldn't be right for us to dump stuff in there.
Our choice for the user folder was motivated by discoverability and the trend of cross platform tools increasingly putting configuration and cached stuff in this location. (e.g. Android Studio, Cocos Creator, Atom, Gradle, and Conan - just to name a few). But we could also consider putting the folder under AppData instead. If we did it this way, we would propose putting it in %LocalAppData% instead because these are files you don't need to have following you around across machines.
Does anyone else following this issue have an opinion on this?
(I mentioned this in #3664, too.) How about you create a cpptools directory inside the ~/.vscode directory (the one where your installed extensions go)? That keeps the VSCode-related stuff together. Sorry, I don't know what that would look like on Windows.
I would say that it's better to follow the platform-specific guidelines (see for example what Chrome does) but doing what other VSCode extensions are doing is also a precedent for you. Tricky. At least it might be sensible to use a more specific directory name ( .vscode.cpptools ?) as your suggestion might not be obvious what it is.
Combining suggestions from this thread with the other one, how does this sound?
Windows
%LocalAppData%\vscode-cpptools
Linux/macOS
~/.vscode-cpptools
The other default path option for Windows can be %LocalAppData%\Microsoft\vscode-cpptools to further indicate that this folder and its contents is from a Microsoft component.
We would like to hear your feedback on any preference.
May I suggest that on Linux, the ipch folder be put under ~/.cache/vscode-cpptools? (Or equivalently, $XDG_CACHE_HOME/vscode-cpptools.) That way, the cached files do not appear as configuration dotfiles in the user's home directory, reducing clutter and making their purpose more obvious, and can also be easily excluded when backing up or synchronizing files, for instance. This is more in line with the conventions followed by other programs when caching user-specific files on Linux.
I for one would like a setting or command that would clear this cache from within VSCode (similar to the clean solution in Visual Studio). I'm an educator that frequently zips up my directories to post as examples for my students to look over. When this change was made I suddenly started getting zips that were too large to post to our LMS.
@natet, the setting that controls the cache size is C_Cpp.intelliSenseCacheSize. Set this to 0 and the extension will delete the cache. Starting in 0.24.0-insiders, we also changed the default cache location to be outside of your workspace folders, so you probably won't even need to do that anymore.