Giter Club home page Giter Club logo

ccls's Introduction

Ccls, which originates from cquery, is a C/C++/Objective-C language server.

It has a global view of the code base and support a lot of cross reference features It starts indexing the whole project (including subprojects if exist) concurrently when you open the first file, while the main thread can serve requests before the indexing is complete. Saving files will incrementally update the index.

improvement

  • {hoverProvider completionProvider,codeActionProvider} option in initializationOptions
{
    "initializationOptions": {
        "client": {
            "snippetSupport": true,
            "hoverProvider": false,
            "completionProvider": false,
            "referencesProvider": false,
            "definationProvider": false,
            "codeActionProvider": false
        },
        "clang": {
            "extraArgs": [
                "-std=c++20",
                "-Wall"
            ]
        }
    }
}

fix

  • type of code from int to std::string
struct Diagnostic {
    lsRange range;
    int severity = 0;
    int code = 0;              -> std::string code= "";
    std::string source = "ccls";
    std::string message;
    std::vector<DiagnosticRelatedInformation> relatedInformation;
    std::vector<TextEdit> fixits_;
};
  • cause clangd use code as type string , if you use ccls with clangd both as your language server, the codeaction will not work for ccls

  • but ccls standalone could be ok !!! so different with #395

  • below is the message sent by coc.nvim ( a vim language client )

{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "textDocument/codeAction",
    "params": {
        "textDocument": {
            ...
        },
        "range": {
            ...
        },
        "context": {
            "diagnostics": [
                {
                    "severity": 1,
                    "code": 2,
                    "source": "ccls",
                },
                {
                    "code": "no_member_suggest",
                    "severity": 1,
                    "source": "clang"
                }
            ],
        }
    }
}

ccls can index itself (~180MiB RSS when idle, noted on 2018-09-01), FreeBSD, glibc, Linux, LLVM (~1800MiB RSS), musl (~60MiB RSS), ... with decent memory footprint.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.