ccls icon indicating copy to clipboard operation
ccls copied to clipboard

ccls not working with Neovim built-in LSP when clang is defined on first line of .ccls

Open AshleighWilson opened this issue 2 years ago • 1 comments

Observed behavior

No features (diagnostics, goto definition, etc) working with ccls when using platformio generated .ccls configuration file and Neovim built-in LSP. From a lot of trial and error I have found that removing "clang" from the first line from the .ccls file allows ccls to work correctly. From the documentation I have read, clang should be the first command at the beginning of the .ccls file, so no idea why this issue is occurring. Apologies if this issue should be raised on another repository (i.e. Neovim?).

I have tested with the minimal configuration as per https://github.com/neovim/nvim-lspconfig and a basic setup with the following structure:

test/

  • .ccls
  • src/
    • test.c

Source files (renamed due to github restrictions): ccls.txt test.txt

LSP Error Logs: not-working-lsp.log working-lsp.log

Expected behavior

I expect diagnostics etc in Neovim with the generated .ccls

Steps to reproduce

Screencast: ccls-error

System information

  • ccls version (git describe --tags --long): ccls version 0.20210330-11-g790daca4 clang version 13.0.1
  • clang version: clang version 13.0.1 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin
  • OS: Arch Linux
  • Editor: Neovim
  • Language client (and version): Neovim built-in LSP client

AshleighWilson avatar Feb 19 '22 08:02 AshleighWilson

I have found that removing "clang" from the first line from the .ccls file allows ccls to work correctly

This just saved me so much time! Thanks @AshleighWilson

mattdavis90 avatar Aug 22 '23 08:08 mattdavis90