fix editor issue

firstlove 2018-11-11 09:12:21 +08:00
parent e5ec341a55
commit bc0dc30ab1

6
FAQ.md

@ -1,6 +1,6 @@
### Some C/C++ headers are not recognized
#### Make sure company-lsp is used
#### if you are emacs user, make sure company-lsp is used
<kbd>M-x</kbd> `company-diag`, make sure`Used backend:` includes `company-lsp`.
There are at least three sets of implicit include paths. They take effect without your `-I` option in `.ccls` or `compile_commands.json`
@ -160,13 +160,13 @@ For headers that are not self-contained (e.g. some `/usr/include/bits/*.h` which
#endif
```
One approach ccls explored before was to compile its import file `a.c`, but it caused severe performance issue for some projects.
One approach ccls explored before was to compile its import file `a.c`, but it caused severe performance issues for some projects.
For smaller files this does not matter and checking for a header guard may help the situation.
### Multi-version headers
A header can be included in different translation units with different compiler flags. It may behave differently via `#ifdef`.
Ideally there should be some mechanism to switch among different views (compiler flags) when you are editing the file.
Ideally, there should be some mechanism to switch among different views (compiler flags) when you are editing the file.
For efficiency, a header is only indexed with one set of compiler flags, so either the `#if` block or `#else` is indexed, the other is left blank.