Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Jul 12, 2018
1 parent c04d062 commit 0c50ee7
Show file tree
Hide file tree
Showing 94 changed files with 444 additions and 282 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ccls

ccls is a fork of cquery (originally written by Jacob Dufault),
ccls is a rewrite of cquery (originally written by Jacob Dufault),
a C/C++/Objective-C language server.

* code completion (with both signature help and snippets)
Expand All @@ -16,16 +16,16 @@ a C/C++/Objective-C language server.

It makes use of C++17 features, has less third-party dependencies and slimmed-down code base. Cross reference features are strenghened, (see [wiki/FAQ](../../wiki/FAQ). It currently uses libclang to index C++ code but will switch to Clang C++ API. Refactoring and formatting are non-goals as they can be provided by clang-format, clang-include-fixer and other Clang based tools.

The comparison with cquery as noted on 2018-05-17:
The comparison with cquery as noted on 2018-07-09:

| | cquery | ccls |
|------------ |--------------------------------|---------------------------|
| third_party | more | fewer |
| C++ | C++14 | C++17 |
| clang API | libclang (C) | libclang + clang/llvm C++ |
| Filesystem | AbsolutePath + custom routines | llvm/Support |
| index | | slight enhancement |
| pipeline | index merge+id remapping | simpler and more robust |
| | cquery | ccls |
|------------ |--------------------------------|------------------------------|
| third_party | more | fewer |
| C++ | C++14 | C++17 |
| clang API | libclang (C) | libclang + clang/llvm C++ |
| Filesystem | AbsolutePath + custom routines | llvm/Support |
| index | libclang | clangIndex, some enhancement |
| pipeline | index merge+id remapping | simpler and more robust |

cquery has system include path detection (through running the compiler driver) while ccls does not.

Expand Down
4 changes: 2 additions & 2 deletions index_tests/constructors/constructor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ void foo() {
"kind": 9,
"storage": 0,
"declarations": [],
"spell": "3:3-3:6|15041163540773201510|2|514",
"spell": "3:3-3:6|15041163540773201510|2|1026",
"extent": "3:3-3:11|15041163540773201510|2|0",
"declaring_type": 0,
"bases": [],
"derived": [],
"vars": [],
"uses": ["7:7-7:8|15041163540773201510|2|8228", "8:17-8:20|15041163540773201510|2|8228"],
"uses": ["7:7-7:8|15041163540773201510|2|16420", "8:17-8:20|15041163540773201510|2|16420"],
"callees": []
}, {
"usr": 4259594751088586730,
Expand Down
6 changes: 3 additions & 3 deletions index_tests/constructors/destructor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ void foo() {
"kind": 9,
"storage": 0,
"declarations": [],
"spell": "3:3-3:6|15041163540773201510|2|514",
"spell": "3:3-3:6|15041163540773201510|2|1026",
"extent": "3:3-3:11|15041163540773201510|2|0",
"declaring_type": 0,
"bases": [],
"derived": [],
"vars": [],
"uses": ["8:7-8:8|15041163540773201510|2|8228"],
"uses": ["8:7-8:8|15041163540773201510|2|16420"],
"callees": []
}, {
"usr": 4259594751088586730,
Expand All @@ -58,7 +58,7 @@ void foo() {
"kind": 6,
"storage": 0,
"declarations": [],
"spell": "4:3-4:4|15041163540773201510|2|514",
"spell": "4:3-4:4|15041163540773201510|2|1026",
"extent": "4:3-4:12|15041163540773201510|2|0",
"declaring_type": 0,
"bases": [],
Expand Down
4 changes: 2 additions & 2 deletions index_tests/constructors/implicit_constructor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ void Make() {
"kind": 9,
"storage": 0,
"declarations": [],
"spell": "2:3-2:7|13487927231218873822|2|514",
"spell": "2:3-2:7|13487927231218873822|2|1026",
"extent": "2:3-2:12|13487927231218873822|2|0",
"declaring_type": 0,
"bases": [],
"derived": [],
"vars": [],
"uses": ["6:8-6:12|13487927231218873822|2|8228", "7:15-7:19|13487927231218873822|2|8228"],
"uses": ["6:8-6:12|13487927231218873822|2|16420", "7:15-7:19|13487927231218873822|2|16420"],
"callees": []
}],
"usr2type": [{
Expand Down
2 changes: 1 addition & 1 deletion index_tests/constructors/invalid_reference.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Foo::Foo() {}
"kind": 9,
"storage": 0,
"declarations": [],
"spell": "4:6-4:9|15041163540773201510|2|514",
"spell": "4:6-4:9|15041163540773201510|2|1026",
"extent": "4:1-4:11|0|1|0",
"declaring_type": 0,
"bases": [],
Expand Down
124 changes: 116 additions & 8 deletions index_tests/constructors/make_functions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ OUTPUT: make_functions.h
"kind": 9,
"storage": 0,
"declarations": [],
"spell": "7:3-7:9|14935975554338052500|2|514",
"spell": "7:3-7:9|14935975554338052500|2|1026",
"extent": "7:3-7:32|14935975554338052500|2|0",
"declaring_type": 0,
"bases": [],
Expand All @@ -52,7 +52,7 @@ OUTPUT: make_functions.h
"kind": 9,
"storage": 0,
"declarations": [],
"spell": "6:3-6:9|14935975554338052500|2|514",
"spell": "6:3-6:9|14935975554338052500|2|1026",
"extent": "6:3-6:17|14935975554338052500|2|0",
"declaring_type": 0,
"bases": [],
Expand All @@ -68,7 +68,7 @@ OUTPUT: make_functions.h
"kind": 9,
"storage": 0,
"declarations": [],
"spell": "5:3-5:9|14935975554338052500|2|514",
"spell": "5:3-5:9|14935975554338052500|2|1026",
"extent": "5:3-5:14|14935975554338052500|2|0",
"declaring_type": 0,
"bases": [],
Expand All @@ -84,7 +84,7 @@ OUTPUT: make_functions.h
"kind": 9,
"storage": 0,
"declarations": [],
"spell": "8:3-8:9|14935975554338052500|2|514",
"spell": "8:3-8:9|14935975554338052500|2|1026",
"extent": "8:3-8:30|14935975554338052500|2|0",
"declaring_type": 0,
"bases": [],
Expand Down Expand Up @@ -138,6 +138,20 @@ OUTPUT: make_functions.cc
}],
"skipped_ranges": [],
"usr2func": [{
"usr": 768523651983844320,
"detailed_name": "",
"qual_name_offset": 0,
"short_name": "",
"kind": 0,
"storage": 0,
"declarations": [],
"declaring_type": 0,
"bases": [],
"derived": [],
"vars": [2555873744476712860, 2555873744476712860, 2555873744476712860],
"uses": [],
"callees": []
}, {
"usr": 2532818908869373467,
"detailed_name": "T *maKE_NoRefs(Args ...args)",
"qual_name_offset": 3,
Expand All @@ -151,7 +165,7 @@ OUTPUT: make_functions.cc
"bases": [],
"derived": [],
"vars": [3908732770590594660],
"uses": ["17:3-17:14|0|1|8228"],
"uses": ["17:3-17:14|0|1|16420"],
"callees": []
}, {
"usr": 2816883305867289955,
Expand All @@ -169,6 +183,34 @@ OUTPUT: make_functions.cc
"vars": [],
"uses": [],
"callees": []
}, {
"usr": 11138976705878544996,
"detailed_name": "",
"qual_name_offset": 0,
"short_name": "",
"kind": 0,
"storage": 0,
"declarations": [],
"declaring_type": 0,
"bases": [],
"derived": [],
"vars": [16395392342608151399],
"uses": [],
"callees": []
}, {
"usr": 11363675606380070883,
"detailed_name": "",
"qual_name_offset": 0,
"short_name": "",
"kind": 0,
"storage": 0,
"declarations": [],
"declaring_type": 0,
"bases": [],
"derived": [],
"vars": [180270746871803062, 180270746871803062, 180270746871803062],
"uses": [],
"callees": []
}, {
"usr": 15793662558620604611,
"detailed_name": "T *MakeUnique(Args &&...args)",
Expand All @@ -183,10 +225,40 @@ OUTPUT: make_functions.cc
"bases": [],
"derived": [],
"vars": [8463700030555379526],
"uses": ["14:3-14:13|0|1|8228", "15:3-15:13|0|1|8228", "16:3-16:13|0|1|8228"],
"uses": ["14:3-14:13|0|1|16420", "15:3-15:13|0|1|16420", "16:3-16:13|0|1|16420"],
"callees": []
}],
"usr2type": [{
"usr": 53,
"detailed_name": "",
"qual_name_offset": 0,
"short_name": "",
"kind": 0,
"declarations": [],
"alias_of": 0,
"bases": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [180270746871803062],
"uses": []
}, {
"usr": 87,
"detailed_name": "",
"qual_name_offset": 0,
"short_name": "",
"kind": 0,
"declarations": [],
"alias_of": 0,
"bases": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [180270746871803062],
"uses": []
}, {
"usr": 12993848456528750350,
"detailed_name": "struct Bar {}",
"qual_name_offset": 7,
Expand Down Expand Up @@ -218,12 +290,36 @@ OUTPUT: make_functions.cc
"uses": ["14:14-14:20|0|1|4", "15:14-15:20|0|1|4", "16:14-16:20|0|1|4", "17:15-17:21|0|1|4"]
}],
"usr2var": [{
"usr": 180270746871803062,
"detailed_name": "int args",
"qual_name_offset": 4,
"short_name": "args",
"declarations": [],
"spell": "9:24-9:28|11363675606380070883|3|1026",
"extent": "9:16-9:28|11363675606380070883|3|0",
"type": 87,
"uses": [],
"kind": 253,
"storage": 0
}, {
"usr": 2555873744476712860,
"detailed_name": "int &&args",
"qual_name_offset": 6,
"short_name": "args",
"declarations": [],
"spell": "4:25-4:29|768523651983844320|3|1026",
"extent": "4:15-4:29|768523651983844320|3|0",
"type": 0,
"uses": [],
"kind": 253,
"storage": 0
}, {
"usr": 3908732770590594660,
"detailed_name": "Args ...args",
"qual_name_offset": 8,
"short_name": "args",
"declarations": [],
"spell": "9:24-9:28|2532818908869373467|3|514",
"spell": "9:24-9:28|2532818908869373467|3|1026",
"extent": "9:16-9:28|2532818908869373467|3|0",
"type": 0,
"uses": [],
Expand All @@ -235,12 +331,24 @@ OUTPUT: make_functions.cc
"qual_name_offset": 10,
"short_name": "args",
"declarations": [],
"spell": "4:25-4:29|15793662558620604611|3|514",
"spell": "4:25-4:29|15793662558620604611|3|1026",
"extent": "4:15-4:29|15793662558620604611|3|0",
"type": 0,
"uses": [],
"kind": 253,
"storage": 0
}, {
"usr": 16395392342608151399,
"detailed_name": "int &&args",
"qual_name_offset": 6,
"short_name": "args",
"declarations": [],
"spell": "4:25-4:29|11138976705878544996|3|1026",
"extent": "4:15-4:29|11138976705878544996|3|0",
"type": 0,
"uses": [],
"kind": 253,
"storage": 0
}]
}
*/
2 changes: 1 addition & 1 deletion index_tests/declaration_vs_definition/class_member.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Foo {
"qual_name_offset": 4,
"short_name": "foo",
"declarations": [],
"spell": "2:7-2:10|15041163540773201510|2|514",
"spell": "2:7-2:10|15041163540773201510|2|1026",
"extent": "2:3-2:10|15041163540773201510|2|0",
"type": 53,
"uses": [],
Expand Down
4 changes: 2 additions & 2 deletions index_tests/declaration_vs_definition/class_member_static.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ int Foo::foo;
"detailed_name": "static int Foo::foo",
"qual_name_offset": 11,
"short_name": "foo",
"declarations": ["2:14-2:17|15041163540773201510|2|513"],
"spell": "5:10-5:13|15041163540773201510|2|514",
"declarations": ["2:14-2:17|15041163540773201510|2|1025"],
"spell": "5:10-5:13|15041163540773201510|2|1026",
"extent": "5:1-5:13|0|1|0",
"type": 53,
"uses": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ int foo(int a, int b) { return 0; }
"qual_name_offset": 4,
"short_name": "b",
"declarations": [],
"spell": "5:20-5:21|2747674671862363334|3|514",
"spell": "5:20-5:21|2747674671862363334|3|1026",
"extent": "5:16-5:21|2747674671862363334|3|0",
"type": 53,
"uses": [],
Expand All @@ -60,7 +60,7 @@ int foo(int a, int b) { return 0; }
"qual_name_offset": 4,
"short_name": "a",
"declarations": [],
"spell": "5:13-5:14|2747674671862363334|3|514",
"spell": "5:13-5:14|2747674671862363334|3|1026",
"extent": "5:9-5:14|2747674671862363334|3|0",
"type": 53,
"uses": [],
Expand Down
8 changes: 4 additions & 4 deletions index_tests/declaration_vs_definition/method.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void Foo::def() {}
"short_name": "declonly",
"kind": 6,
"storage": 0,
"declarations": ["2:8-2:16|15041163540773201510|2|513"],
"declarations": ["2:8-2:16|15041163540773201510|2|1025"],
"declaring_type": 0,
"bases": [],
"derived": [],
Expand All @@ -32,7 +32,7 @@ void Foo::def() {}
"short_name": "purevirtual",
"kind": 6,
"storage": 0,
"declarations": ["3:16-3:27|15041163540773201510|2|577"],
"declarations": ["3:16-3:27|15041163540773201510|2|1089"],
"declaring_type": 0,
"bases": [],
"derived": [],
Expand All @@ -46,8 +46,8 @@ void Foo::def() {}
"short_name": "def",
"kind": 6,
"storage": 0,
"declarations": ["4:8-4:11|15041163540773201510|2|513"],
"spell": "7:11-7:14|15041163540773201510|2|514",
"declarations": ["4:8-4:11|15041163540773201510|2|1025"],
"spell": "7:11-7:14|15041163540773201510|2|1026",
"extent": "7:1-7:19|0|1|0",
"declaring_type": 0,
"bases": [],
Expand Down
4 changes: 2 additions & 2 deletions index_tests/enums/enum_class_decl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ enum class Foo : uint8_t {
"short_name": "A",
"hover": "Foo::A = 0",
"declarations": [],
"spell": "3:3-3:4|16985894625255407295|2|514",
"spell": "3:3-3:4|16985894625255407295|2|1026",
"extent": "3:3-3:4|16985894625255407295|2|0",
"type": 0,
"uses": [],
Expand All @@ -64,7 +64,7 @@ enum class Foo : uint8_t {
"qual_name_offset": 0,
"short_name": "B",
"declarations": [],
"spell": "4:3-4:4|16985894625255407295|2|514",
"spell": "4:3-4:4|16985894625255407295|2|1026",
"extent": "4:3-4:9|16985894625255407295|2|0",
"type": 0,
"uses": [],
Expand Down
Loading

0 comments on commit 0c50ee7

Please sign in to comment.