Clarify clang.pathMapping

Fangrui Song 2018-11-20 21:08:28 -08:00
parent 8069512751
commit 3b74971efd

@ -32,18 +32,18 @@ You may use `clang.excludeArgs` to exclude GCC specific options that are unknown
## `clang.pathMappings`
If cache files were built with project root `/tmp/container`, and you want to reuse them with a different project root `/host`:
If cache files were built with project root `/tmp/container/proj`, and you want to reuse them with a different project root `/host/proj`:
```javascript
{ "clang": { "pathMappings": ["/container:/host"] }
{ "clang": { "pathMappings": ["/container/:/host/"] }
```
Copy cache files:
```zsh
rsync -a /tmp/ccls/@tmp@container/ /tmp/ccls/@tmp@host/ # files under project root
rsync -a /tmp/ccls/@@tmp@container/ /tmp/ccls/@@tmp@host/ # files outside of project root
rsync -a /tmp/ccls/@tmp@container@proj/ /tmp/ccls/@tmp@host@proj/ # files under project root
rsync -a /tmp/ccls/@@tmp@container@proj/ /tmp/ccls/@@tmp@host@proj/ # files outside of project root
```
Open `/tmp/host/a.cc`, the cache file `/tmp/ccls/@tmp@host/a.cc.blob` will be reused. When `a.cc` is saved (re-indexed), the newly generated `a.cc.blob` will not contain `/tmp/container` paths any more.
Open `/tmp/host/proj/a.cc`, the cache file `/tmp/ccls/@tmp@host@proj/a.cc.blob` will be reused. When `a.cc` is saved (re-indexed), the newly generated `a.cc.blob` will not contain `/tmp/container` paths any more.
## `client.snippetSupport`