MaskRay / ccls

C/C++/ObjC language server supporting cross references, hierarchies, completion and semantic highlighting
Apache License 2.0
3.73k stars 254 forks source link

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

Open AshleighWilson opened 2 years ago

AshleighWilson commented 2 years ago

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/

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

mattdavis90 commented 1 year ago

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