Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

Add unqlite database option #624

Open
wants to merge 121 commits into
base: master
Choose a base branch
from
Open

Conversation

decimad
Copy link

@decimad decimad commented Apr 15, 2018

Work in progress

Joel Hock and others added 15 commits July 13, 2018 23:13
The default json serializer omits std::optional fields that aren't
present, but LSP requires exactly one of |result| or |error| to be
present in every json rpc response.  This change fixes the responses of
cquery/{callHierarchy,inheritanceHierarchy,memberHierarchy} so they
always specify a |result| field, even when it's null.
Doubtful anyone used it, and we should try to not unnecessarily extend
the LS protocol.
Along the same lines as the previous commit, try to avoid extending LSP.
Not really needed anymore, as cquery is fairly LSP compliant and the
vscode client auto-updates.
jacobdufault and others added 30 commits July 13, 2018 23:38
Blacklist -march= and -Wl,-arch
* Create `GetHomedirectory()` function

This platform specific function is used to get the user's home
directory. This gives us a base from where to get the global config
file for.

Currently WIP as I'm not sure how to implement this for Windows.

* Find and parse .cquery in home dir if not in project dir

* GetHomeDirectory() -> GetGlobalConfigDirectory()

* Windows specific implementation of `GetGlobalConfigDirectory()`

This is a tentative implementation, I don't have access to windows so
haven't tested it but based on MSDN and StackOverflow this seems to be
the way to go.

* Update *nix implementation of `GetGlobalConfigDirectory()`

As discussed in jacobdufault#648, fallback to $HOME if $XDG_CINFIG_HOME is not
found.

* Use a global .cquery file if none found in the project dir

* Add rational to usage of XDG_CONFIG_HOME

* Create "cquery" directory in .config if it does not exist

* Fix up  on Windows

* Only call `CoTaskMemFree` if `ShGetKnownFolderpath` passes

* Refactor config to optional to improve control flow

* Add comment referencing MSDN blog on getting config dir on Windows

* Implicitly call string constructor using = operator

* Add braces around if-else block

* Fixup some errors introduced when making config optional

* config -> cfg

* Fixup crash when assigning to config

* Load global .cquery config at end of LoadCompilationEntriesfromdirectory

Previously the global .cquery config was being loaded before the
project specific compile_commands.json file. The global .cquery config
is intended as a fallback when there are no other configs, so we don't
want this.

To make it explicit that the global .cquery is being loaded, add a new
parameter to LoadFromDirectorylisting (use_global_config) which, if
true, will load the global .cquery. This parameter defaults to false,
so no changes are required to existing calls.

* Add reference for usage of CoTaskMemFree after SHGetKnownFolderPath

* Load the local .cquery in all cases that it is present
- use AbsolutePath in favor of NormalizePath
- fix Enqueue/Push_Back
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet