Update lsp to new api
This updates from the old lspconfig plugins to the new lua lsp api and removes my old ccls config.
This commit is contained in:
+6
-33
@@ -45,38 +45,11 @@ cmp.setup.cmdline(':', {
|
||||
matching = { disallow_symbol_nonprefix_matching = false }
|
||||
})
|
||||
|
||||
|
||||
-- Set up lspconfig.
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
local lsp = require('lspconfig')
|
||||
|
||||
-- lsp.ccls.setup{
|
||||
-- capabilities = capabilities,
|
||||
-- init_options = {
|
||||
-- cache = {
|
||||
-- directory = vim.fn.expand("~/.cache/ccls") -- Store index globally
|
||||
-- },
|
||||
-- compilationDatabaseDirectory = "build", -- Uses 'build/compile_commands.json' if present
|
||||
-- highlight = { lsRanges = true }, -- Improves semantic highlighting
|
||||
-- index = {
|
||||
-- threads = 4, -- Adjust based on your CPU (more threads = faster indexing)
|
||||
-- initialBlacklist = { ".*_test.cpp", ".*_unittest.cpp" }
|
||||
-- -- initialBlacklist = { ".*_test.cpp", ".*_unittest.cpp", "/home/furtest/linux_bidouille/.*" } -- Avoid indexing test files
|
||||
-- },
|
||||
-- completion = {
|
||||
-- detailedLabel = true -- Better completion info
|
||||
-- },
|
||||
-- diagnostics = {
|
||||
-- onChange = 300 -- Delay diagnostics updates for better performance
|
||||
-- }
|
||||
-- }
|
||||
-- }
|
||||
|
||||
|
||||
-- clangd and ccls are both C and C++ language servers
|
||||
-- having them both active at the same time is useless
|
||||
lsp.clangd.setup {
|
||||
capabilities = capabilities,
|
||||
cmd = { "clangd", "--enable-config" },
|
||||
vim.lsp.config.clangd = {
|
||||
cmd = { 'clangd', '--background-index' },
|
||||
root_markers = { 'compile_commands.json', 'compile_flags.txt', '.clangd' },
|
||||
filetypes = { 'c', 'cpp' },
|
||||
}
|
||||
|
||||
vim.lsp.enable({'clangd'})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user