Commit Graph

289 Commits

Author SHA1 Message Date
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
Jacob Dufault
104cfd167c Fix linux build 2017-09-13 10:53:13 -07:00
Jacob Dufault
17565f9a14 Make some good progress on e2e tests. 2017-09-12 20:35:53 -07:00
Jacob Dufault
6cdb7c66e1 Remove unused function 2017-08-18 10:26:05 -07:00
Jacob Dufault
3f44307268 Call malloc_trim(0) on Linux 2017-08-17 11:02:47 -07:00
Jacob Dufault
b1d9602682 Dedup import requests, show diagnostics on interactive indexes, priority index file when opening it 2017-08-16 20:39:00 -07:00
Jacob Dufault
58fbd04142 Add ThreadedQueue::EnqueueAll to reduce lock contention. 2017-08-16 19:14:54 -07:00
Jacob Dufault
28ddc9f346 Re-enable anonymous namespace in command_line.cc 2017-08-16 19:08:00 -07:00
Jacob Dufault
4245bac1db Make import pipeline a bit more flexible w.r.t. writing indexed content to disk. 2017-08-16 19:06:28 -07:00
Jacob Dufault
d5bdf8ce0a Rename/cleanups 2017-08-15 22:45:42 -07:00
Jacob Dufault
7901653698 Make sure file exists before importing it. 2017-08-15 22:39:50 -07:00
Jacob Dufault
49aca3038b Cache timestamps when importing, which improves import time by 5x on windows.
cquery import goes from 2.5s to 0.5s
2017-08-15 20:54:59 -07:00
Jacob Dufault
274c98f032 Fix import pipeline stall due to blocking Deqeue call. 2017-08-15 20:29:49 -07:00
Jacob Dufault
3ab4d0455d Fix delta update.
Previous file was being loaded after the current file is written to disk.
2017-08-15 00:46:21 -07:00
Jacob Dufault
59851c06e0 More import pipeline simplifications.
Move already-import dependency checking to a separate stage.
2017-08-15 00:22:13 -07:00
Jacob Dufault
5a451d3ad1 Remove some additional overhead created for out of process 2017-08-14 22:53:44 -07:00
Jacob Dufault
db9a97d586 Remove out of process indexer support.
malloc_trim does a good enough job that we don't need it anymore.
2017-08-14 19:07:46 -07:00
Jacob Dufault
ee003a2cf0 Log when we are doing delta updates 2017-08-05 15:44:44 -07:00
Jacob Dufault
5b69c5bfc5 Small cleanup 2017-08-01 20:40:30 -07:00
Jacob Dufault
cac5dcaf8f Simplify queue management 2017-08-01 20:23:37 -07:00
Jacob Dufault
50a726f59e Simplify Index_OnIdMapped 2017-07-30 11:49:24 -07:00
Jacob Dufault
1f3f69b221 Reuse loaded file contents in indexer; clear large state before caching. 2017-07-30 11:31:41 -07:00
Jacob Dufault
85f3c00376 Some more small cleanup 2017-07-30 00:16:08 -07:00
Jacob Dufault
6d9e4242d1 Use shared_ptr, try to fix a crash. 2017-07-29 23:51:32 -07:00
Jacob Dufault
e771f05f3f Linux build fixes 2017-07-29 21:46:21 -07:00
Jacob Dufault
ee20d79dcc wip 2017-07-29 21:24:02 -07:00
Jacob Dufault
c37396a36d First pass at logging using loguru 2017-07-27 19:14:46 -07:00
Jacob Dufault
475afc77a5 Support functions in type hierarchy. 2017-07-20 19:53:08 -07:00
Jacob Dufault
f4db0967b2 Show based/derived callers in callers keyboard shortcut. 2017-07-19 00:12:29 -07:00
Jacob Dufault
ba973ba1bf Remove unused variables 2017-07-17 10:41:59 -07:00
Jacob Dufault
22bb89fca1 Add options to turn off diagnostics.
diagnostics.onParse: semi-real time diagnostics that reported when a file is indexed or prepared for code completion
diagnostics.onCodeComplete: real time diagnostics that are reported as you type
2017-07-15 17:25:52 -07:00
Jacob Dufault
d1cbc32c81 Hopefully fix completion crashes.
It was caused due to a multithreading race. A vector was assigned to twice at the same time, which caused a crash in the destructor.
2017-06-29 23:51:22 -07:00
Jacob Dufault
f498f0ccb1 Fix showing duplicate completion entries, always provide insertText. 2017-06-28 23:59:38 -07:00
Jacob Dufault
b4000fa956 Don't show code lens on include/header guards. 2017-06-28 23:34:04 -07:00
Jacob Dufault
85ec4b9843 Use shared_ptr in command_line for completion data.
Also add thread exit logs so to check if the stack has gone away.
2017-06-28 21:59:16 -07:00
Jacob Dufault
3228619414 Small fixes to auto-include and auto-implement fixits. 2017-06-28 21:40:30 -07:00
Jacob Dufault
25d450cf8b Always include literal completions 2017-06-28 21:33:52 -07:00
Jacob Dufault
706479aded Completion changes (maybe fix some crashes) 2017-06-28 19:50:30 -07:00
Jacob Dufault
a005cc627d Generate diagnostics when indexing a file, even if non-interactive. 2017-06-19 18:52:25 -07:00
Jacob Dufault
491e7b4625 Prefer literal string matches in global symbol search 2017-06-19 18:32:19 -07:00
James Cook
5b4986f04b Fix compiler warnings and turn on warnings as errors 2017-06-19 18:30:44 -07:00
Jacob Dufault
b04ce0c503 Auto-index file on open 2017-06-15 22:56:07 -07:00
Jacob Dufault
bb46b38b1c Make global symbol search a bit more fuzzy 2017-06-15 19:30:00 -07:00
Jacob Dufault
9d1369786f Pre-filter completion results before sending to vscode.
This results in a less laggy completion experience. Before, vscode would
drop frames if handed too many completions (ie, by typing #include in a
very large project).
2017-06-15 19:28:49 -07:00
Jacob Dufault
99db0a1596 Add some additional code completion logging. 2017-06-14 22:47:41 -07:00
Jacob Dufault
7a71447273 Move some code out of command_line.cc 2017-06-14 22:47:41 -07:00
Jacob Dufault
053aa549f0 Bump extension version. 2017-06-14 00:13:26 -07:00
Jacob Dufault
14009293ba Fix IPC message e2e hiding 2017-06-13 23:59:40 -07:00
Jacob Dufault
3d0b8fd807 Fix call tree when function ref does not refer to a function. 2017-06-13 23:50:30 -07:00
Jacob Dufault
4bddc95908 Fix possible race when setting diagnostics. 2017-06-13 23:29:41 -07:00
Jacob Dufault
584f7b45b9 Uniqueify include string proposals 2017-06-13 23:09:25 -07:00
Jacob Dufault
8fece6c252 Remove some extra logging 2017-06-13 20:41:30 -07:00
Jacob Dufault
dec484ed0d Only report diagnostics from code completion document parse.
Also use shared_ptr, hopefully fix memory crashes.
2017-06-09 21:13:16 -07:00
Jacob Dufault
c262e1674d Misc fixes 2017-06-09 18:02:48 -07:00
Jacob Dufault
767b4ac0e1 Small code cleanup 2017-06-09 00:08:06 -07:00
Jacob Dufault
1fc2d2756e Don't show output when there is an error. Force extension update. 2017-06-08 23:26:04 -07:00
Jacob Dufault
c40df5c0e5 Provide code action to auto-include an undefined symbol. 2017-05-29 16:57:19 -07:00
Jacob Dufault
f5efa02448 Clear diagnostics for open files. 2017-05-29 16:33:57 -07:00
Jacob Dufault
d834d4db08 Provide code action to auto-implement methods (useful for classes or function declarations). 2017-05-29 14:18:35 -07:00
Jacob Dufault
968b6c0966 Remove HasInterestingState().
These don't serve any real purpose since the multi-file indexer tests.
2017-05-27 00:47:03 -07:00
Jacob Dufault
79a4d8ad79 Proper error reporting when request fails due to missing file. 2017-05-27 00:10:21 -07:00
Jacob Dufault
385531521f Harden against bad language server method call in completion. 2017-05-26 23:51:32 -07:00
Jacob Dufault
d816e2618a Some renames, promote view completion sessions to edit sessions 2017-05-26 21:21:00 -07:00
Jacob Dufault
7840b7a015 Cache global completion results. 2017-05-26 00:10:55 -07:00
Jacob Dufault
cdc268d549 Preload code completion, maintain LRU cache for multiple completion files. 2017-05-25 23:40:38 -07:00
Jacob Dufault
2e3e1e0427 Refactor quote extraction 2017-05-25 21:26:35 -07:00
Jacob Dufault
f5ed2828c3 Fix code lens sometimes appearing on "};" 2017-05-25 21:09:10 -07:00
Jacob Dufault
8bbd9b7694 Revert change to use CXTranslationUnit_Incomplete when indexing. It broke tests. 2017-05-24 20:06:05 -07:00
Jacob Dufault
32940e2c88 Experiment with caching CXIndex across multiple sessions 2017-05-24 19:04:19 -07:00
Jacob Dufault
97832f2a73 Add call tree and full type hierarchy using upcoming vscode tree API 2017-05-24 00:17:29 -07:00
Jacob Dufault
1598129d8b Fix file finding on windows when path case changes. 2017-05-22 00:14:11 -07:00
Jacob Dufault
da6a8f335f Only delta update on file save if the file is already imported. 2017-05-21 23:18:38 -07:00
Jacob Dufault
639bf8a431 Show error message when regex parsing fails. 2017-05-21 22:54:27 -07:00
Jacob Dufault
c66c927c1f Fix some more warnings from clang 2017-05-21 16:48:21 -07:00
Jacob Dufault
8910d0a13e Fix warnings (almost all numeric cast-related) 2017-05-21 16:22:00 -07:00
Jacob Dufault
e182ac12ae Elide long include path proposals 2017-05-21 14:01:52 -07:00
Jacob Dufault
864ff122d8 Scan include directories for include completion candidates. 2017-05-21 12:51:15 -07:00
Jacob Dufault
94bd6fc301 Add #include auto-complete. 2017-05-21 00:37:53 -07:00
Jacob Dufault
7a79532fff Report document links on includes 2017-05-20 21:30:59 -07:00
Jacob Dufault
41e1dff4c9 Goto definition for includes 2017-05-20 20:47:20 -07:00
Jacob Dufault
d3bd31604e Code lens improvements
- Hide declaration from list of refs on types and variables (so now they will show as '0 refs')
- Let the user hide code lens on parameter and function-local variables
2017-05-20 18:26:50 -07:00