cquery-project / emacs-cquery

Emacs client for cquery, a low-latency language server supporting multi-million line C++ code-bases
116 stars 14 forks source link

Add caching directory flexibility #49

Closed ambihelical closed 6 years ago

ambihelical commented 6 years ago

Add cquery-cache-dir-function custom function and two implementations. The function converts the project path to a cache location for that project.

The first implementation (the default), cquery-cache-dir-in-project returns a project relative path, and should maintain current behavior.

The second implementation, cquery_cache-dir-consolidated returns a path relative to cquery-cache-dir-consolidated-path. It munges the project path to make a unique name for the name of a directory to store the cache.

The default value of cquery-cache-dir-consolidate-path is "cquery-cache.d" relative to the users emacs.d directory.

The intended purpose of this change is to make it easier to keep index files for all cquery projects in one central location, enabling one or more of the following things: