aboutsummaryrefslogtreecommitdiff
path: root/lua/user/lsp/settings/ccls.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/user/lsp/settings/ccls.lua')
-rw-r--r--lua/user/lsp/settings/ccls.lua34
1 files changed, 34 insertions, 0 deletions
diff --git a/lua/user/lsp/settings/ccls.lua b/lua/user/lsp/settings/ccls.lua
new file mode 100644
index 0000000..d663f7c
--- /dev/null
+++ b/lua/user/lsp/settings/ccls.lua
@@ -0,0 +1,34 @@
+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=/home/aleksa/mygit/mykernel/sysroot", "--gcc-toolchain=/usr/bin/i686-elf-gcc", "-ffreestanding", "-nobuiltininc"};
+else
+end
+
+
+lspconfig.ccls.setup {
+ on_attach = on_attach,
+ flags = {
+ debounce_text_changes = 150,
+ };
+ init_options = {
+ compilationDatabaseDirectory = "build";
+ cache = {
+ directory = "/tmp/ccls-cache";
+ };
+ index = {
+ threads = 0;
+ };
+ clang = {
+ excludeArgs = { "-frounding-math"};
+ extraArgs = extraArgs_opt;
+ }
+ };
+}