#1509 broke lsp-mode for ccls
https://github.com/bbatsov/projectile/pull/1509 broke lsp-mode for ccls, which is expecting compile_commands.json (generated by CMake) in the project root.
Probably the build dir should be made configurable in projectile instead of hardcoding build.
Expected behavior
ccls finds compile_commands.json in the project root
Actual behavior
ccls does not find compile_commands.json in the project root because it's in ./build.
Steps to reproduce the problem
Open a CMake C project, try to use LSP. FWIW, my config can be found here.
Environment & Version information
Projectile version information
Projectile 20200329.1908
Emacs version
GNU Emacs 26.1 (build 1, x86_64-apple-darwin14.5.0, NS appkit-1348.17 Version 10.10.5 (Build 14F2511))
Operating system
MacOS 10.15
I'm fine with adding a configuration option for this.
Is this about in ccls? For me right now ccls works ok.
Cmake projects don't like in tree builds in most cases, so this would have been broken without the prior PR.
Well for me with compile_commands.json inside the ./build subdir, ccls starts but does not yield any helpful results. If I copy the generated compile_commands.json to the project root, ccls works and can do jump-to-definition and show-references and all that.
Anyway, I think it makes sense for projectile to default to an out-of-source build, I worked around the ccls issue by letting CMake copy the generated compile_commands.json to the project root. Therefore, feel free to close @bbatsov
Well for me with compile_commands.json inside the
./buildsubdir, ccls starts but does not yield any helpful results. If I copy the generated compile_commands.json to the project root, ccls works and can do jump-to-definition and show-references and all that.
Jokes on me, I was using project.el which quacks like a projectile.
Setting compilationDatabaseDirectory in ccls might help as explained in MaskRay/ccls#903.
Setting
compilationDatabaseDirectoryin ccls might help as explained in MaskRay/ccls#903.
Yeah, and it'd be super awesome if emacs (projectile, lsp-mode, ...) would set this automagically.
Edit: ccls (or rather emacs-ccls) seems to consult projectile about project roots, so probably the compile_commands.json location should be set in projectile or rather https://github.com/emacs-lsp/emacs-ccls which might get the build dir info from projectile.