2018-03-31 03:16:33 +00:00
# ccls
2017-04-26 01:47:10 +00:00
2018-07-19 05:10:40 +00:00
[![Telegram ](https://img.shields.io/badge/telegram-@cclsp-blue.svg )](https://telegram.me/cclsp)
[![Gitter ](https://img.shields.io/badge/gitter-ccls--project-blue.svg?logo=gitter-white )](https://gitter.im/ccls-project/ccls)
ccls, which originates from [cquery ](https://github.com/cquery-project/cquery ), is a C/C++/Objective-C language server.
2017-06-14 07:08:25 +00:00
2017-05-15 07:31:44 +00:00
* code completion (with both signature help and snippets)
2018-10-24 03:09:27 +00:00
* [definition ](src/messages/textDocument_definition.cc )/[references](src/messages/textDocument_references.cc), and other cross references
2018-09-23 05:55:17 +00:00
* cross reference extensions: `$ccls/call` `$ccls/inheritance` `$ccls/member` `$ccls/vars` ...
2018-09-28 05:19:26 +00:00
* formatting
2018-09-23 05:55:17 +00:00
* hierarchies: [call (caller/callee) hierarchy ](src/messages/ccls_call.cc ), [inheritance (base/derived) hierarchy ](src/messages/ccls_inheritance.cc ), [member hierarchy ](src/messages/ccls_member.cc )
* [symbol rename ](src/messages/textDocument_rename.cc )
2018-09-01 22:37:09 +00:00
* [document symbols ](src/messages/textDocument_documentSymbol.cc ) and approximate search of [workspace symbol ](src/messages/workspace_symbol.cc )
* [hover information ](src/messages/textDocument_hover.cc )
* diagnostics and code actions (clang FixIts)
* semantic highlighting and preprocessor skipped regions
2018-09-23 05:55:17 +00:00
* semantic navigation: `$ccls/navigate`
2018-09-01 22:37:09 +00:00
It has a global view of the code base and support a lot of cross reference features, see [wiki/FAQ ](../../wiki/FAQ ).
It starts indexing the whole project (including subprojects if exist) parallelly when you open the first file, while the main thread can serve requests before the indexing is complete.
Saving files will incrementally update the index.
Compared with cquery, it makes use of C++17 features, has less third-party dependencies and slimmed-down code base.
It leverages Clang C++ API as [clangd ](https://clang.llvm.org/extra/clangd.html ) does, which provides better support for code completion and diagnostics.
2018-09-28 05:19:26 +00:00
Refactoring is a non-goal as it can be provided by clang-include-fixer and other Clang based tools.
2018-05-17 06:49:21 +00:00
2018-07-15 07:57:48 +00:00
The comparison with cquery as noted on 2018-07-15:
2018-05-17 06:49:21 +00:00
2018-07-10 06:40:26 +00:00
| | cquery | ccls |
|------------ |--------------------------------|------------------------------|
| third_party | more | fewer |
| C++ | C++14 | C++17 |
2018-07-15 07:57:48 +00:00
| clang API | libclang (C) | clang/llvm C++ |
2018-07-10 06:40:26 +00:00
| Filesystem | AbsolutePath + custom routines | llvm/Support |
| index | libclang | clangIndex, some enhancement |
| pipeline | index merge+id remapping | simpler and more robust |
2018-05-17 06:49:21 +00:00
2018-07-15 07:57:48 +00:00
cquery has system include path detection (through running the compiler driver) while ccls uses clangDriver.
2017-04-18 04:53:34 +00:00
2018-05-05 03:40:52 +00:00
# >>> [Getting started](../../wiki/Getting-started) (CLICK HERE) <<<
2017-04-18 04:53:34 +00:00
2018-05-05 03:40:52 +00:00
* [Build ](../../wiki/Build )
2018-11-16 04:53:04 +00:00
* [Client feature table ](../../wiki/Client-feature-table )
2018-05-05 03:40:52 +00:00
* [FAQ ](../../wiki/FAQ )
2018-09-01 22:37:09 +00:00
ccls can index itself (~180MiB RSS when ide, noted on 2018-09-01), FreeBSD, glibc, Linux, LLVM (~1800MiB RSS), musl (~60MiB RSS), ... with decent memory footprint. See [wiki/compile_commands.json ](../../wiki/compile_commands.json ) for examples.