aboutsummaryrefslogtreecommitdiff
path: root/lua/user/lsp/ccls.lua
diff options
context:
space:
mode:
authorAleksa Vučković <aleksav013@gmail.com>2022-01-18 01:31:23 +0100
committerAleksa Vučković <aleksav013@gmail.com>2022-01-18 01:31:23 +0100
commite056fe78a29edbe377445c0fcb5854bec122dee8 (patch)
tree108f09fbfe301568e2c9bd1fb22df2241fa93412 /lua/user/lsp/ccls.lua
parent75177e174bd9d95937e3f4df1766ac28705b1f6a (diff)
ccls fixed, bufferline, nvim-tree
Diffstat (limited to 'lua/user/lsp/ccls.lua')
-rw-r--r--lua/user/lsp/ccls.lua37
1 files changed, 37 insertions, 0 deletions
diff --git a/lua/user/lsp/ccls.lua b/lua/user/lsp/ccls.lua
new file mode 100644
index 0000000..9127e5b
--- /dev/null
+++ b/lua/user/lsp/ccls.lua
@@ -0,0 +1,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;
+ }
+ };
+}