Commit Graph

56 Commits

Author SHA1 Message Date
Fangrui Song
ed96b807dd Style 2018-01-14 13:43:04 -08:00
Fangrui Song
0bad74eb4f Comment Paul Heckel's diff algorithm which is used to align confident lines in index and buffer 2018-01-14 13:24:55 -08:00
Jacob Dufault
e20a6e9790 Add siphash.h, HashUSR -> HashUsr 2018-01-14 13:18:12 -08:00
Fangrui Song
54ac72115e Change line/column to 0-based and only use 1-based when (de,)serialized to JSON 2018-01-14 11:54:23 -08:00
Fangrui Song
f78d87ded3 Unify {all,raw}_buffer_lines
Also remove GetBufferLineContentFromIndexLine
2018-01-14 11:06:07 -08:00
Fangrui Song
865d567c10 Ignore stdout SIGPIPE 2018-01-14 10:05:29 -08:00
Fangrui Song
d099afb0cc Fix performance issue in Paul Heckel's diff algorithm 2018-01-14 01:49:41 -08:00
Fangrui Song
a47115208b Find best match between two bounds found by Paul Heckel's diff algorithm
The best match is computed by Eugene W. Myers' O(ND) edit distance algorithm.
2018-01-14 01:37:17 -08:00
Fangrui Song
eec5c77d6a Use Paul Heckel's diff algorithm to convert between buffer/index line number 2018-01-14 00:23:04 -08:00
Fangrui Song
942a0354d3 Use UTF-8 character iterator in GetOffsetForPosition which is good unless UTF-16 surrogate pairs are used #57 2018-01-13 10:43:37 -08:00
Fangrui Song
feb0249350 Fix textDocument/didClose to use TextDocumentIdentifier 2018-01-12 18:59:25 -08:00
Jacob Dufault
93ba0c532b For completion, only tell clang about relevant dirty working files.
The heuristic may not be perfect, but it is probably good enough.
clang_codeCompleteAt seems to get slower as more and more CXUnsavedFile
instances are uploaded.
2018-01-12 09:39:05 -08:00
scturtle
16f6fdbef1 Fix shrinking region. (#290) 2018-01-12 08:44:11 -08:00
Fangrui Song
060b92b214 Change lsVersionedTextDocumentIdentifier::version to variant<monostate,int>
version: number | null

Maybe we need to change it to double
2018-01-09 23:57:44 -08:00
Jacob Dufault
06870d5b61 Do not show completion candidates for : or > by itself.
Fixes issue #258.
2018-01-07 14:27:57 -08:00
Jacob Dufault
181b405c54 Remove some debug code 2018-01-06 12:32:58 -08:00
Joel Hock
0c9f572637 freeze state of WorkingFiles to insulate them from async changes
before shipping unsaved state off to clang
2018-01-06 11:26:09 -08:00
Jacob Dufault
bbe11e32eb Prefer WriteToFile over manual std;:ofstream usage. 2018-01-05 10:02:53 -08:00
Jacob Dufault
b8e7a5bcb3 Format code 2017-12-27 07:54:46 -08:00
Fangrui Song
20c156f71d Make lsTextDocumentContentChangeEvent::{range,rangeLength} optional. fix #185 (#189)
Also make lsVersionedTextDocumentIdentifier::version optional per specification
2017-12-25 00:58:26 -08:00
Jacob Dufault
a1fd516788 Log stack trace when there is bad index/buffer lines 2017-12-12 09:50:12 -08:00
Jacob Dufault
b65a30c3f7 Move Ipc_* types into messages/ 2017-12-05 20:41:44 -08:00
Jacob Dufault
5d1fd4ce4d Remove a bunch of std::cerr in favor of LOG_S 2017-12-01 17:04:39 -08:00
Jacob Dufault
9b44bf7901 Run ./format.sh 2017-12-01 09:55:41 -08:00
Peter Elmers
750cc4ea30 Respond to comment 2017-11-26 12:12:59 -05:00
Peter Elmers
3341b1f13d Only replace text if both rangeLength and range are not set 2017-11-26 12:12:59 -05: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
084d5c8d91 Fix two TODOs 2017-09-26 21:40:47 -07:00
Jacob Dufault
f5314b62b1 Reformat to Chromium style. 2017-09-21 18:14:57 -07:00
Jacob Dufault
c83b9eab77 Fix issue when buffer contents do not get synced properly near start of file 2017-07-29 21:13:22 -07:00
Jacob Dufault
ba973ba1bf Remove unused variables 2017-07-17 10:41:59 -07:00
Jacob Dufault
8dd751a70f Fix completion for items with underscores. 2017-06-19 23:31:34 -07:00
Jacob Dufault
11af3986ba Better symbol resolution (ie, goto definition) for macro arguments. 2017-06-15 23:43:02 -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
7a71447273 Move some code out of command_line.cc 2017-06-14 22:47:41 -07:00
Jacob Dufault
4bddc95908 Fix possible race when setting diagnostics. 2017-06-13 23:29:41 -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
7840b7a015 Cache global completion results. 2017-05-26 00:10:55 -07:00
Jacob Dufault
8910d0a13e Fix warnings (almost all numeric cast-related) 2017-05-21 16:22:00 -07:00
Jacob Dufault
7a79532fff Report document links on includes 2017-05-20 21:30:59 -07:00
Jacob Dufault
29845cc1e3 Cache code completion results for backspace character. 2017-05-20 01:07:29 -07:00
Jacob Dufault
3001faf9a8 Signature help and snippets for code completion 2017-05-15 00:29:22 -07:00
Jacob Dufault
1083a10a66 Fix some threading bugs with code completion 2017-05-09 21:52:15 -07:00
Jacob Dufault
e1e45b6dc5 Emit warning for bad working file index instead of crashing. 2017-05-06 22:34:43 -07:00
Jacob Dufault
c77531a432 Log initialization options, reactivate working file asserts. 2017-04-25 19:57:36 -07:00
Jacob Dufault
11d6623938 Update WorkingFile indexed content correctly.
We copy the file contents we indexed over to the index cache folder. Then we load those file contents into the WorkingFile instance as needed.

This means code lens should never get out of sync, as the index buffer cache will always be correct.
2017-04-20 23:32:18 -07:00
Jacob Dufault
ea045499b6 When looking up symbols map buffer line to index line.
This makes editing experience a bit smoother, as you can goto definition before saving.
2017-04-19 00:52:48 -07:00
Jacob Dufault
2e8e3d29c5 Indexer spelling lookup cannot fail 2017-04-18 16:49:55 -07:00
Jacob Dufault
26c0bfe71d Misc fixes 2017-04-17 13:40:50 -07:00