Vscode-cpptools: Change the default intelliSenseCachePath/databaseFilename to "~/.cpptools" instead of ${workspaceFolder}/.vscode and ${workspaceStorage}

Created on 18 May 2019  ·  13Comments  ·  Source: microsoft/vscode-cpptools

This would prevent the space used by all ipch across all workspaces to be bounded by the intelliSenseCacheSize instead of being unbounded (i.e. the size limit wouldn't be per workspace).

Feature Request Language Service fixed (release pending)

All 13 comments

I hope you can combine intelliSenseCachePath and cpptools database storage path to be one path which name may be “cpptoolsStoragePath”. And then you can add subfolders for intelliSenseCache and db storage path. If so, we just need to set this path 'cpptoolsStoragePath'.
It's strange to set database filename instead of database storage path.

Such as:
If I don't set cpptoolsStoragePath,it's like this:
1
If I set cpptoolsStoragePath to "D:\VsCodeCpptoolsStoragePath"
2

Yeah, I think we should be able to use the same workspace storage hash for the per-workspace browse database files as well.

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.

Referencing issues

  • .vscode caching too much data since update #3347
  • Disable IntelliSense caching by default? #3616

In general, I like the proposal.

One minor nit: the name ".cpptools" is a bit generic; if I saw it in my home directory, I don't think I would realize it had anything to do with VSCode. I already have a ~/.vscode directory. What about putting it inside there, say, ~/.vscode/cpptools? Or, if that's a problem for some reason, maybe ~/.vscode_cpptools?

I agree that ".cpptools" is too generic. Maybe we should use the full extension name "ms-vscode.cpptools".

Based on the feedback posted so far, the request is for the name to show that the folder is related to VS Code as well as the extension cpptools. Is this correct?

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.

@michelleangela The browse.databaseFilename was not changed to use the same default location...should a new issue be created for that?

@michelleangela The browse.databaseFilename was not changed to use the same default location...should a new issue be created for that?

We should create a new issue for that. This thread was for IntelliSense cache path.

Please consider using $XDG_CACHE_HOME and fall back to ~/.cache on Linux following the XDG Base directory specification: https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

There's a comprehensive proposal on how files should be organized in each platform for vscode here: https://github.com/microsoft/vscode/issues/3884.

We're tracking the $XDG_CACHE_HOME issue with https://github.com/microsoft/vscode-cpptools/issues/3860 .

Was this page helpful?
0 / 5 - 0 ratings