Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    Dan Čermák
    I meant 0.20190823.5
    David Manouchehri
    How do I refresh semantic highlighting in VS Code without having to manually close and reopen the file? Is there a hotkey or something I'm missing?
    Christian Maniewski

    Hey! I seem to be doing something stupid. ccls seems to be parsing all my .h files as C (as opposed to cpp, even if a corresponding .cpp files exists). I tried to add these lines to my .ccls file:

    %h -x
    %h c++-header

    with no luck, I'm still getting unknown type name 'class'. Is there anything else I could try?

    The only way I can get around this currently is to rename the .h file to .hpp but that doesn't seem optimal to me (just for consistency with all the other libraries that I'm using and for which that doesn't seem to be a problem). For a little context, I'm using the auto-generated .ccls file provided by platformio
    Rob Blafford
    Hi not sure where to post this but i'll place it here. Just want to advise the contributors that i have found and fixed a potential issue. ccls has been crashing on me, upon further investigation I discovered that the --resource-dir parameter was incorrect. It was pointing to /usr/lib64/clang/9.0 instead of version 10.0.0. I have updated from fedora 31 to 32 (i.e. by way of the os update script)
    omit your build/ directory or move it outside of your projects root dir
    if you just want ccls to parse some types of files, you can pass one or more regexs to initialBlacklist
    Christian Maniewski
    @graphcareful thanks but I'm not sure how this relates to my problem. Sorry but I'm a bit confused here
    Patrick Ziegler
    @graphcareful This happens when clang is updated without ccls being recompiled. Because ccls will query the current resource dir during compilation and will use that as the default.
    Christian Maniewski
    I'm still not sure where my above issue originates from. I'm wondering if I could cut out ale (which I'm using as an LSP client) to see whether it's coming from there
    Christian Maniewski
    OK, if I change %c -std=c++11 in the .ccls file it works. But that seems rather wrong. Shouldn't it detect it somehow?
    I thought that's what %h c++-header is supposed to do
    Christian Maniewski
    It works now. Not sure what did it, but here's the whole config:
    %h -x c++-header
    %c -std=c11
    %cpp -std=c++11
    Edward C
    why my ccls cannot use std::of stream's function now? It can work before.

    Anyone have issues with CCLS timing out when using pre-compiled headers?
    I'm specifically using Cmake's target_precompile_headers with Coc-nvim (on neovim).

    The precompiled headers are correctly building, but any time I start browsing files, ccls times out instead of doing anything.
    It stops recommending fixes, showing errors, etc. It's like it's just off.

    But then I simply comment out the target_precompile_headers and re-build with cmake, and all of a sudden it's working as expected.

    I'm using the coc-settings.json recommended in the coc wiki, if it matters.

    kangyampeta srinivas
    Hi I am trying to build ccls on a debian box without any root permission and which does not have ncurses library builtin. I have manually built in the ncurses library. I have set the LD_LIBRARY_PATH, but build does not recognize libnucurses.so (6.1) from this directory. How do you manually provide the location of the ncurses library to ccls.
    Dan Čermák
    ccls needs ncurses??
    not on my machine:
    ldd /usr/bin/ccls
            linux-vdso.so.1 (0x00007ffc86326000)
            libclang-cpp.so.10 => /usr/lib64/libclang-cpp.so.10 (0x00007fa9c35c9000)
            libLLVM.so.10 => /usr/lib64/libLLVM.so.10 (0x00007fa9be779000)
            libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fa9be5a3000)
            libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fa9be589000)
            libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fa9be567000)
            libc.so.6 => /lib64/libc.so.6 (0x00007fa9be3a1000)
            /lib64/ld-linux-x86-64.so.2 (0x00007fa9c67e0000)
            libedit.so.0 => /usr/lib64/../lib64/libedit.so.0 (0x00007fa9be365000)
            libz.so.1 => /lib64/libz.so.1 (0x00007fa9be34b000)
            libdl.so.2 => /lib64/libdl.so.2 (0x00007fa9be346000)
            libtinfo.so.6 => /lib64/libtinfo.so.6 (0x00007fa9be315000)
            libm.so.6 => /lib64/libm.so.6 (0x00007fa9be1cf000)
            libxml2.so.2 => /usr/lib64/../lib64/libxml2.so.2 (0x00007fa9be066000)
            liblzma.so.5 => /usr/lib64/liblzma.so.5 (0x00007fa9be028000)
    kangyampeta srinivas
    /env_build/cmake/CMake/bin/cmake --build Release
    [ 2%] Linking CXX executable ccls
    /usr/bin/ld: cannot find -lncurses
    collect2: error: ld returned 1 exit status
    CMakeFiles/ccls.dir/build.make:733: recipe for target 'ccls' failed
    make[2]: [ccls] Error 1
    CMakeFiles/Makefile2:136: recipe for target 'CMakeFiles/ccls.dir/all' failed
    [CMakeFiles/ccls.dir/all] Error 2
    Makefile:129: recipe for target 'all' failed
    make: * [all] Error 2
    kangyas@rpcs02: ~/env_build/ccls (master) $
    Dan Čermák
    ah, wait you're building the master branch?
    kangyampeta srinivas
    Should I build anything else? Which branch is recommended?
    George Xanthakis
    @MaskRay Some time ago I have been trying to build ccls on CentOS and you told me If I make it work to give you an update. So in order to make it work I built a newer gcc(9.1) and also built clang(10.0.0) and with some missing packages from the package manager the master branch ccls built successfully. So when I find some free time I am going to update the wiki on how to build ccls on Centos.
    kangyampeta srinivas
    Anything can be done to build ccls on debian without ncurses?
    Hi, there
    I am having trouble configuring ccls with coc.nvim
    I use Arch Linux, and installed ccls using "pacman -S ccls"
    Followed these instructions and tried first example: https://github.com/MaskRay/ccls/wiki/coc.nvim
      "diagnostic.infoSign": "--",
      "diagnostic.displayByAle": true,
      "typescript.showUnused": false,
      "javascript.showUnused": false,
      "languageserver": {
        "ccls": {
          "command": "ccls",
          "filetypes": ["c", "cpp", "cuda", "objc", "objcpp"],
          "rootPatterns": [".ccls-root", "compile_commands.json"],
          "initializationOptions": {
            "cache": {
              "directory": ".ccls-cache"
            "client": {
              "snippetSupport": true
            "completion": {
              "placeholder": true
    Here is my :CocConfig
    Am I doing everything correctly?
    After following these steps nothing seems to work
    I am facing the same issue as @nullpointer666
    :CocList services shows languageserver.ccls [init]. Should that [init] be [running]?
    @nullpointer666 what does your :CocList services show for ccls?
    Carlo Nucera

    hi, I'm experiencing problems in indexing, I get a lot of errors like:

    12:52:54 indexer1          indexer.cc:1340 E failed to index /path/nix/src/libutil/args.cc

    but, in the project root folder, I did make clean && bear make -j5, and I have a compile_commands.json. Could you point how I should debug this?

    @MaskRay ^
    Fangrui Song
    retrieve the clang command line and run it in the terminal https://github.com/MaskRay/ccls/wiki/Debugging
    Carlo Nucera
    sorry, I'm completely new on c++ tooling, this project is compiled with gcc, and I have a Makefile
    @the-shank [init
    Carlo Nucera
    does that mean that I should build ccls in debug mode @MaskRay
    probably cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=gcc is enough? Let me try
    Fangrui Song
    building ccls in debug mode can allow you to attach a debugger to the ccls process
    -G 'Unix Makefiles' can be omitted.
    Simon Pintarelli
    I'm using ccls with emacs, it seems that if I open a file located in a git worktree the root directory is wrongly determined. It takes the path to main git checkout. Is ccls computing the root directory or is that done by lsp-mode?
    Fangrui Song
    @simonpintarelli The root directory is computed by lsp-mode. emacs-ccls sets an advice: (advice-add 'lsp--suggest-project-root :before-until #'ccls--suggest-project-root)
    Simon Pintarelli
    Thank you.