Closed Maverobot closed 4 years ago
Two alternatives:
ln -s build/compile_commands.txt .
touch .ccls-root
+ (setq ccls-initialization-options '(:compilationDatabaseDirectory "build"))
https://github.com/MaskRay/ccls/wiki/Customization#compilationdatabasedirectoryYour alternatives require creating file in every project I visit. Sometimes I just want to visit a project and have a quick look without having to create either a soft link or .ccls-root
. Can you please explain your reason not wanting .ccls-root
to be configurable? It seems to me rather an enhancement to your library.
locate-dominating-file compile_commands.json
is actually a regression.
Say you have out/release/compile_commands.json
(not everyone uses build/
as a build directory. And I generally consider that name inappropriate because usually you want to differentiate debug builds from release builds). You have generated source files in out/release/a/b.cc
.
Now locate-dominating-file
can erroneously think out/release/
is the root directory, which is apparently wrong.
See https://github.com/MaskRay/ccls/wiki/FAQ#project-root-detection
I see your point.
How about remove compile_commands.json
and build/compile_commands.json
from the changes while keeping ccls-root-files
configurable? This way its default behavior would be exactly as it is now.
If the user desires to add build/compile_commands.json
, he can add it by appending it to ccls-root-files
and is aware of that. Since .ccls-root
will be tried first, if .ccls-root
can be found, it will still behave normally in your mentioned case.
ccls-root-files
would be similar to projectile-project-root-files-top-down-recurring
in projectile.el.
ccls-root-files
: (".ccls-root")
is good.
PR has been updated. Please let me know if there is anything to be changed.
This PR made root search list configurable via
ccls-root-files