From e056fe78a29edbe377445c0fcb5854bec122dee8 Mon Sep 17 00:00:00 2001 From: Aleksa Vučković Date: Tue, 18 Jan 2022 01:31:23 +0100 Subject: ccls fixed, bufferline, nvim-tree --- lua/user/lsp/ccls.lua | 37 +++++++++++++++++++++++++++++++++++++ lua/user/lsp/init.lua | 2 +- lua/user/lsp/settings/ccls.lua | 34 ---------------------------------- 3 files changed, 38 insertions(+), 35 deletions(-) create mode 100644 lua/user/lsp/ccls.lua delete mode 100644 lua/user/lsp/settings/ccls.lua (limited to 'lua/user/lsp') 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; + } + }; +} diff --git a/lua/user/lsp/init.lua b/lua/user/lsp/init.lua index c218647..744c4ec 100644 --- a/lua/user/lsp/init.lua +++ b/lua/user/lsp/init.lua @@ -6,4 +6,4 @@ end require "user.lsp.lsp-installer" require("user.lsp.handlers").setup() -require "user.lsp.settings.ccls" +require "user.lsp.ccls" diff --git a/lua/user/lsp/settings/ccls.lua b/lua/user/lsp/settings/ccls.lua deleted file mode 100644 index f182d8a..0000000 --- a/lua/user/lsp/settings/ccls.lua +++ /dev/null @@ -1,34 +0,0 @@ -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 = 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; - } - }; -} -- cgit v1.2.3