diff --git a/FAQ.md b/FAQ.md index 1000ab1..da4887f 100644 --- a/FAQ.md +++ b/FAQ.md @@ -44,18 +44,36 @@ If you want the ccls binary at a specific location use a symlink - do not move t ### Project root detection -For C++ projects, `compile_commands.json` is used by [emacs-ccls](https://github.com/MaskRay/emacs-cquery/) to mark the project root. This is usually a symlink to the real `compile_commands.json` in a build directory: +[emacs-ccls](https://github.com/MaskRay/emacs-cquery/) locates the project root with `ccls-project-root-matchers`: + +* `.ccls-root`. If this file exists in any parent directory, that directory is treated as the project root. +* `projectile-project-root`. Then this function is called. You likely don't want `/usr/include/c++/8/algorithm` to be treated as in the project `/usr/include/c++/8/`, `(setq projectile-require-project-root t)` inhibit the behavior. + +Then ccls will find `.ccls` or `compile_commands.json` in the root directory. ``` proj - build - gen - generated_file_in_build.cc + .ccls-root # Use this file if you want subproject files to be associated with the root project compile_commands.json - compile_commands.json -> build/compile_commands.json + subproj0 + .git + subproj1 + .git ``` -In this example, the `:rootUri` of the generated C++ file is `proj/build/` because of `proj/build/compile_commands.json`. However, the user wants it to be `proj/`. Customize `MaskRay-root-matchers`. +### Maximum number of file descriptors + +When indexing ccls itself, some files require more than 1000 file descriptors. Remember to increase `RLIMIT_NOFILE`. + +```zsh +ulimit -n 32768 +``` + +`/etc/security/limits.conf`: +``` +* hard nofile 32768 +* soft nofile 32768 +``` ### Includes