Commit Graph

269 Commits

Author SHA1 Message Date
Jacob Dufault
9b44bf7901 Run ./format.sh 2017-12-01 09:55:41 -08:00
Jacob Dufault
066166ba40 Add --clang-sanity-check.
Does a simple index test to verify expected libclang API behavior.
2017-12-01 09:46:40 -08:00
topisani
ab6c5f0515 Emit semantic highlighting for types 2017-12-01 09:42:22 -08:00
topisani
c4ada3e9df Don't highlight operators as functions (#104)
* Don't highlight operators as functions

* address comments
2017-12-01 17:08:19 +01:00
topisani
28ad5b1ed1 Index file language and send it on hover 2017-11-30 14:12:41 -08:00
Jacob Dufault
f4acde7588 Add --log-stdin-stdout-to-stderr
Prints messages received and stdin/stdout to stderr. Useful when developing a new client that uses cquery as the backend.
2017-11-29 20:22:10 -08:00
Jacob Dufault
68f6d34693 Only wait when running index tests on windows. 2017-11-29 19:09:10 -08:00
nobody
c7ef44ad53 Fix hang during reading from stdin
I experienced this hang problem when using cquery with
LanguageClient-neovim.

Sometimes std::cout would hang because the pipe is full, which would
normally be fine, since the client would read from the pipe soon.
However, in this case the client is blocking on a write(). This
shouldn't happen, because cquery has a stdin thread which constantly
reads from stdin. But, in C++, cin and cout are tied streams. Reading
from cin would cause cout to flush, which cause the read to block.

So, cquery can't write because the client doesn't read, the client won't
read before it finishes writing. It can't finish writing because cquery
can't read, and cquery can't read because cquery can't write. Which is a
deadlock.

The solution is to simply untie cin and cout.
2017-11-28 13:58:11 -05:00
Fangrui Song
87f6452b5d Rename clang_args to .cquery 2017-11-27 12:31:54 -05:00
Josh Elsasser
76785105ed Add an option to disable EmitProgress methods during indexing 2017-11-26 19:50:57 -05:00
Walter Erquinigo
3cee3cb775 Support an optional compilation database dir at initialization 2017-11-26 12:11:09 -05:00
Peter Elmers
6f6cd4ea7f Give default value to compileCommandsDirectory 2017-11-26 12:11:09 -05:00
Peter Elmers
b7059e69d7 Add compileCommandsDirectory to config struct 2017-11-26 12:11:09 -05:00
Jacob Dufault
5f73c7efac Allow running unit and index tests separately 2017-11-19 14:35:16 -08:00
Jacob Dufault
97417ecc93 Reformat code 2017-11-19 14:11:54 -08:00
Fangrui Song
297ed1d13e Use indented TEST_SUITE 2017-11-19 14:13:11 -05:00
Jacob Dufault
0376da015f Try to always log when exiting. 2017-11-18 11:02:09 -08:00
Jacob Dufault
7b0d2d7bf2 Make sure to send initialize response before status updates 2017-11-17 13:31:48 -08:00
Abhinav Gauniyal
27a00d7ad3 Update command_line.cc, fixes #14
- error: lambda capture 'working_files' is not used
 - error: lambda capture 'config' is not used
2017-11-17 07:35:15 -08:00
Jacob Dufault
42f744ba29 Remove some unused code. 2017-11-11 11:43:55 -08:00
Jacob Dufault
601af73ca9 Move all libclangmm/* files into src/* directory 2017-11-11 11:41:09 -08:00
Jacob Dufault
5fa7fbf0d2 More improvements to semantic highlighting. Still not done though. 2017-11-11 11:18:55 -08:00
Jacob Dufault
8145a06534 First pass at semantic highlighting.
It is disabled by default.
2017-11-08 23:06:32 -08:00
Jacob Dufault
7d549f3fdf Move libclangmm/Utility.h into clang_utils.h 2017-11-04 16:02:39 -07:00
Jacob Dufault
172f9e2e80 Remove tiny-process-library 2017-11-04 15:23:08 -07:00
Jacob Dufault
4156be09c1 Fix inactive region after closing/reopening a document.
Also make it a bit more robust.
2017-10-28 15:09:14 -07:00
Jacob Dufault
82f8133d7e Log to cquery_diagnostics.log instead of cquery.log 2017-10-28 14:51:12 -07:00
Jacob Dufault
61b0cfb114 Don't emit ipc timings for cout messages. 2017-10-28 14:33:33 -07:00
Jacob Dufault
b9f72377dd Fix inactive region publishing when editing a file. 2017-10-28 14:31:54 -07:00
Jacob Dufault
235987bb58 Show progress indicator in status area 2017-10-25 00:12:11 -07:00
Jacob Dufault
39de197e8a Only target 80% of threads for indexers by default.
Using 100% - 1 tended to cause too much resource contention.
2017-10-24 19:18:47 -07:00
Jacob Dufault
58f2107714 Inject -resource-dir automatically. 2017-10-24 18:02:15 -07:00
Jacob Dufault
a6807dcb8c Remove issue where diagnostics would disappear file saves.
Also allow rebuilding of completion session by closing and reopening a
file.
2017-10-17 11:43:33 -07:00
Jacob Dufault
809a55a351 When erasing a USR only erase def data.
This should hopefully fix some bad indexes. It is possible that a def is temporarily deleted. In that case, we don't want to nuke all of the callers/etc so that if the def is restored we still have that information.

If the def is actually erased it the normal IndexUpdate remove logic will eventually purge the extra state outside of just the def (ie, callers).
2017-10-16 22:45:26 -07:00
Jacob Dufault
272e23901c Handle missing cached dependencies better 2017-10-12 08:41:03 -07:00
Jacob Dufault
7531a0b4e5 Real-time indexing as you type. 2017-09-26 23:03:43 -07:00
Jacob Dufault
80df5beee5 Fix code completion isIncomplete handling.
isIncomplete would not be set to true when there was no filter text but we elided entries.
2017-09-26 21:44:56 -07:00
Jacob Dufault
d57ecff497 Disable not sending isIncomplete optimization 2017-09-25 14:33:28 -07:00
Jacob Dufault
145975df6b Fix some issues in import pipeline. 2017-09-23 17:36:28 -07:00
Jacob Dufault
5704ef5077 Cleanup completion logging. Also don't mark isIncomplete for completion results as aggressively. 2017-09-21 19:45:17 -07:00
Jacob Dufault
772f547065 Update diagnostics on document change, not code completion.
This also changes the API used for reporting diagnostics, which will hopefully be more reliable. This requires reparsing the document, though, so it is much slower. We do this after reporting code completion though, so hopefully the performance delay is not too noticable.
2017-09-21 19:25:33 -07:00
Jacob Dufault
1df8fd7c7a Remove some static_casts. 2017-09-21 18:32:55 -07:00
Jacob Dufault
772df3e92a Move InsertSymbolIntoResult into query_utils.cc 2017-09-21 18:18:24 -07:00
Jacob Dufault
f5314b62b1 Reformat to Chromium style. 2017-09-21 18:14:57 -07:00
Jacob Dufault
1b1be28be4 Log files joined in IndexFile merges. 2017-09-21 17:59:46 -07:00
Jacob Dufault
ba7461fc24 Fix dependency scanning on import.
The same dependency would cause multiple translation units to get reindexed.
2017-09-19 22:08:17 -07:00
Jacob Dufault
a06f730958 Better logging, add notes about a bug. 2017-09-14 00:22:06 -07:00
Jacob Dufault
d6a8071da4 Be more aggressive about only indexing files once.
This should help fix perf regressions with long import times after syncing.
2017-09-13 23:39:32 -07:00
Jacob Dufault
036c2819f1 Add some whitespace 2017-09-13 22:18:15 -07:00
Jacob Dufault
cd58eafd90 Simplify import dedup by allowing indexer to reparse the same document concurrently. Removes a critical section simplifies the code.
Instead we dedup the imports between creating an id map and applying the update.
2017-09-13 21:51:39 -07:00