Open skywind3000 opened 6 years ago
Sure, this sounds reasonable.
I'm interested in implementing this feature. I've been looking over the code base and am struggling to find where the .cquery
file is loaded. Could someone point me in the right direction?
This function handles loading from .cquery
:
https://github.com/cquery-project/cquery/blob/1fa36852b5dbe0d8e8207b1362a150c722a077c7/src/project.cc#L456-L514
Great! Thank you :smile:
A couple things:
.cquery
file from $HOME/.config/cquery
as opposed to just putting it at $HOME
C:\Users\<user>\AppData\Roaming\cquery
would be the best spot.What I plan to do:
$XDG_CONFIG_HOME/cquery
on *nixconfig_path + "/cquery"
in:
SHGetKnownFolderPath ( FOLDERID_RoamingAppData, KF_FLAG_CREATE, NULL, &config_path )))
For linux, what about reading $XDG_CONFIG_HOME
and defaulting to $HOME/.cquery
if not present?
A single global config SGTM.
Adding a function GetGlobalConfigDir
to platform.h is one potential approach.
FYI, per XDG basedir convention, config dir should be at $HOME/.config/cquery/ when XDG_CONFIG_HOME is not defined and $XDG_CONFIG_HOME/cquery/ when it is. So if it is desired to be consistent with this generally spottily-followed specification, this isn't really doing it right. However, this is an improvement over only $HOME/.cquery, IMO.
I've done a few XDG basedir retrofits, and I've usually checked for the original config file in $HOME, and if it doesn't exist there follow the basedir spec. This way no one's existing config breaks and the basedir spec is followed for new installs.
Is it possible to have environment variables in the .cqeury
file?
I use conda and installed my gcc compilers inside conda environment. The include path should look like -I$CONDA_PREFIX/include/c++/6.1.0
I don't know. I think most of the config file stuff is just passed on to clang and a quick google doesn't suggest anything. I did a quick test on my machine and it didn't seem to effect code completion. Does it work for you?
I have to copy same
.cquery
every where, it contains only few lines:Can I have a global
.cquery
file likeC:\Users\MyName\.config\cquery\settings
to setup include paths ?? YouCompleteMe can allow me have a global config.