From 021bf498694021ea25c69b8715b3be37921d33cb Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 26 Dec 2018 17:46:01 -0800 Subject: [PATCH] Update FAQ: -resource-dir is no longer recorded --- FAQ.md | 62 +++++++--------------------------------------------------- 1 file changed, 7 insertions(+), 55 deletions(-) diff --git a/FAQ.md b/FAQ.md index 6207bdf..b0e915b 100644 --- a/FAQ.md +++ b/FAQ.md @@ -33,10 +33,6 @@ For CMake this can be achieved in a single line: `target_include_directories( .ccls` * emacs-ccls: `(setq ccls-extra-init-params '(:clang (:extraArgs ["-isystem" "/tmp/include"])))` +### Inspect index files + +Read [[Initialization options]] how to set `"cacheFormat": "json"`. + +If `"cacheDirectory": "/tmp/ccls"`, and the source file is `/tmp/c/a.cc`, +run `jq . < /tmp/ccls/@tmp@c/a.cc.json` + ### Project root detection [emacs-ccls](https://github.com/MaskRay/emacs-cquery/) locates the project root in the following order: @@ -88,57 +91,6 @@ ulimit -n 32768 * soft nofile 32768 ``` -### Includes - -Here is an example. - -`include/a.h`: -```c -int bad; -``` - -`a.cc`: -```c -int main(){return bad;} -``` - -`.ccls`: -```text -%clang -%cpp -std=gnu++14 --Iinclude -``` - -ccls will save a file in `cacheDirectory`: -`jq . < /tmp/ccls/@tmp@c/a.cc.json` -```json -15 -{ - "last_modification_time": 1520737513, - "language": 1, - "import_file": "/tmp/c/a.cc", - "args": [ - "clang++", - "-working-directory=/tmp/c", - "-std=gnu++14", - "-Iinclude", - "/tmp/c/a.cc", - "-resource-dir=/home/maskray/Dev/Util/ccls/build/debug/lib/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-14.04/lib/clang/6.0.0", - "-Wno-unknown-warning-option", - "-fparse-all-comments" - ], - "includes": [ - { - "line": 0, - "resolved_path": "/tmp/c/include/a.h" - } - ], - "dependencies": [ - "/tmp/c/include/a.h" - ], - ... -``` - ### Diagnostics in headers For efficiency, headers are compiled on their own (as if `clang [options] a.h`) to utilize Clang's preamble optimization.