aboutsummaryrefslogtreecommitdiff
path: root/lua/user/lsp/ccls.lua
blob: 9127e5b8f759f7156215ace236c3c7917b27bc9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
local status, lspconfig = pcall(require, "lspconfig")
if not status then
    return
end


vim.notify(vim.fn.expand('%:p'));
local extraArgs_opt = {};

if string.match(vim.fn.expand('%:p'),"/home/aleksa/mygit/mykernel/") then
    extraArgs_opt = { "--sysroot=/opt/aleksa", "--gcc-toolchain=/opt/aleksa/usr/bin/i686-aleksa-gcc", };
else
end


lspconfig.ccls.setup {

    on_attach = require("user.lsp.handlers").on_attach,
    capabilities = require("user.lsp.handlers").capabilities,

    flags = {
        debounce_text_changes = 150,
    };
    init_options = {
    compilationDatabaseDirectory = "build";
    cache = {
       directory = "/tmp/ccls-cache";
    };
    index = {
        threads = 0;
    };
    clang = {
        excludeArgs = { "-frounding-math"};
        extraArgs = extraArgs_opt;
        }
    };
}