I was using ccls on the linux kernel. On some files it seems to show the diagnostics for another file instead. For example in this screenshot, it's saying a bunch of comments are using an undeclared identifier:
I also tried strace -s999 -e read,write -fp $(pgrep -fn ccls) to get the actual output from ccls, and I saw among others
`{\"uri\":\"file:///root/linux/kernel/bpf/verifier.c\",\"diagnostics\":[{\"range\":{\"start\":{\"line\":4,\"character\":0},\"end\":{\"line\":4,\"character\":13}},\"severity\":1,\"code\":2,\"source\":\"ccls\",\"message\":\"use of undeclared identifier 'sk_filter_verifier_ops'; did you mean 'bpf_verifier_ops'?\"`
so I think it's not that the language client is showing it wrong.
Expected behavior
Diagnostics for the correct file should be shown.
Steps to reproduce
For reproducibility I'm doing this in a docker image I built, which is based on a recent debian-unstable base image:
docker run -it --rm cnly/dotfiles-full:latest-20220509-c3a091c
The following steps are run inside the container:
git clone --depth 1 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
apt install -y libelf-dev bison bc flex libncursesw5-dev lld-13
ccls --version
clang-13 --version
# Following the steps in wiki here, but compiling with gcc gives the same problems
cd linux
make O=/tmp/out/x86_64 ARCH=x86_64 LLVM=1 LLVM_SUFFIX=-13 defconfig
make O=/tmp/out/x86_64 ARCH=x86_64 LLVM=1 LLVM_SUFFIX=-13 -k -j $(nproc) bzImage modules
scripts/clang-tools/gen_compile_commands.py -d /tmp/out/x86_64
nvim kernel/bpf/verifier.c # One of the problematic files
System information
These are obtained from the docker container above.
ccls version (git describe --tags --long): 0.20210330-12-g74458915
Observed behavior
I was using ccls on the linux kernel. On some files it seems to show the diagnostics for another file instead. For example in this screenshot, it's saying a bunch of comments are using an undeclared identifier:
It seems these diagnostics are from other files.
Minimal
compile_commands.json
:I also tried
strace -s999 -e read,write -fp $(pgrep -fn ccls)
to get the actual output from ccls, and I saw among othersso I think it's not that the language client is showing it wrong.
Expected behavior
Diagnostics for the correct file should be shown.
Steps to reproduce
For reproducibility I'm doing this in a docker image I built, which is based on a recent debian-unstable base image:
The following steps are run inside the container:
System information
These are obtained from the docker container above.
git describe --tags --long
):0.20210330-12-g74458915
NVIM v0.7.0
coc.nvim version: 0.0.80-8ed12040 2022-05-17 12:20:38 +0000