ccls icon indicating copy to clipboard operation
ccls copied to clipboard

Look in parent directories of source files for compile_commands.json

Open milesgranger opened this issue 3 years ago • 1 comments

Please forgive me if I've overlooked some setting or otherwise misunderstood my current experience. :)

Observed behavior

It seems ccls looks for one compile_commands.json in the root (or configurable) of the project. However, some projects will have multiple compile_commands.json files. Having recently switched from clangd, my experience there is it would look for these files in parent directories of the source file, allowing one to edit source files belonging to different sub-projects.

From clangd website:

Often, a compilation database specifies these compile commands. clangd searches for compile_commands.json in parents of the source file.

Expected behavior

For ccls to find compile_commands.json for source files which may be part of different sub projects.

System information

  • ccls version : 0.20220729-0-g74458915
  • clang version: 7.0.0-3~ubuntu0.18.04.1 (tags/RELEASE_700/final
  • OS: Fedora 36
  • Editor: Helix
  • Language client (and version):

milesgranger avatar Oct 18 '22 13:10 milesgranger

Same issue here,the root of project contains several sub module,the json files are located in the sub-build dirs,ccls cant find them so the cache files are empty.

FavonianKong avatar Dec 12 '23 13:12 FavonianKong