ccls
ccls copied to clipboard
Permanent "not indexed" error with Clang 12 and above
Observed behavior
Everything works great when I compile ccls against versions of Clang up to and including 11.1.0.
When I compile ccls against anything newer (well, tested with 12.0 and 14.0), and no other changes at all just a different clang, then I get nothing: all I see in my LSP client is "not indexed". LSP mode shows in the minibuffer:
LSP :: Error from the Language Server: not indexed (Invalid Request)
I've enabled --log-file=ccls.out -v=9 and looked at the log file and there is absolutely nothing odd there: no error messages or warnings or anything.
I've enabled client logging on the Emacs LSP mode and all I ever get back from ccls is:
[Trace - 02:03:46 PM] Received response 'nil - (22)' in 999ms.
Result: {
"message": "not indexed",
"code": -32600
}
[Trace - 02:03:46 PM] Received response 'textDocument/documentHighlight - (23)' in 31ms.
Result: {
"message": "not indexed",
"code": -32600
}
It appears that indexing never proceeds or succeeds, but there's absolutely nothing that I can find in any logging that would explain why or how to fix it.
Also, no files are ever created in the .ccls-cache directory!
Steps to reproduce
I doubt it's reproducible outside my environment, unless others also have problems using Clang 12+.
What I really need is some kind of pointer that allows me to get more debugging or figure out why the indexing just never seems to do anything. Is there a way to compile ccls with more debugging output?
System information
- ccls version: 0.20210330-11-g790daca4
- clang version: clang 12.0, clang 14.0
- OS: GNU/Linux
- Editor: Emacs 27.2
- Language client (and version): Emacs lsp-mode 20220401.1003 (but have tried various) and ccls-20200820.308
If you use something like ccls --index $root, there is a log at src/indexer.cc:1367 LOG_S(ERROR) << "failed to index " << main. The variable reason may be interesting.
Interactive debugging may help. cgdb --args path/to/debug/ccls --index $root