ccls icon indicating copy to clipboard operation
ccls copied to clipboard

ccls fails with multiple project roots

Open awoodx opened this issue 2 years ago • 2 comments

Observed behavior

In my set-up, I'm using nvim and I have several projects each with their own compile_commands.json and .ccls files. Eg.

./projA/compile_commands.json
./projA/.ccls
./projA/src/srcA.cpp
./projB/compile_commands.json
./projB/.ccls
./projB/src/srcB.cpp
./projC/compile_commands.json
./projC/.ccls
./projC/src/srcC.cpp

The issue I have is that if I start nvim and open a file from one project, ccls works fine. When I open a file from one of the other projects, ccls starts erroring out. When I look at the lsp logs, I see a lot of errors like this:

ERROR][2023-02-08 08:02:34] .../vim/lsp/rpc.lua:733 "rpc" "ccls" "stderr" "08:02:34 indexer1 utils.cc:177 E failed to write to ....@[email protected]@[email protected] No such file or directory\n"

In this case, I opened a file from projA, and ccls is trying to write to projB's .ccls-cache directory.

When I check the processes running, I see only one instance of ccls running. I would think each project instance would have it's own ccls instance. clangd which works with my set-up is using a different instance for each project.

Expected behavior

Each project should have it's own ccls instance, or for ccls to handle each project independently.

Steps to reproduce

Described above.

System information

  • ccls version (git describe --tags --long): compiled HEAD
  • clang version: clang 15.0.6
  • OS: Linux
  • Editor: nvim
  • Language client (and version): Neovim LSP

awoodx avatar Feb 08 '23 13:02 awoodx

ccls processes are spawned by the client, so I think you'll need to check your setup.

MaskRay avatar Feb 08 '23 20:02 MaskRay

02:09:37                     utils.cc:177 E failed to write to player_hero.cpp/.ccls-cache/@player_hero.cpp/@Library@Developer@CommandLineTools@[email protected]@usr@include@c++@v1@__type_traits@remove_cv.h Not a directory

I use lsp-bridge, the project is a win32 project, but i open it in macos, same error here.

getong avatar Apr 23 '23 18:04 getong