refactor lsp
This commit is contained in:
parent
b48c2e9acf
commit
68450346a1
2
init.lua
2
init.lua
|
@ -949,7 +949,7 @@ require('lazy').setup({
|
||||||
-- This is the easiest way to modularize your config.
|
-- This is the easiest way to modularize your config.
|
||||||
--
|
--
|
||||||
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
||||||
{ import = 'custom.plugins' },
|
-- { import = 'custom.plugins' },
|
||||||
--
|
--
|
||||||
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
|
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
|
||||||
-- Or use telescope!
|
-- Or use telescope!
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
local lspconfig = require 'lspconfig'
|
-- local Path = require 'plenary.path'
|
||||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
|
||||||
local Path = require 'plenary.path'
|
|
||||||
local pickers = require 'telescope.pickers'
|
local pickers = require 'telescope.pickers'
|
||||||
local finders = require 'telescope.finders'
|
local finders = require 'telescope.finders'
|
||||||
local conf = require('telescope.config').values
|
local conf = require('telescope.config').values
|
||||||
|
@ -50,6 +48,9 @@ function M.pick_target()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.setup()
|
function M.setup()
|
||||||
|
local lspconfig = require 'lspconfig'
|
||||||
|
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||||
|
|
||||||
lspconfig.clangd.setup {
|
lspconfig.clangd.setup {
|
||||||
cmd = make_clangd_cmd(),
|
cmd = make_clangd_cmd(),
|
||||||
filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda' },
|
filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda' },
|
||||||
|
@ -59,4 +60,6 @@ function M.setup()
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
M.setup()
|
||||||
|
|
||||||
|
return {}
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
return {
|
||||||
|
require 'custom.plugins.lsp.lsp',
|
||||||
|
require 'custom.plugins.lsp.clangd',
|
||||||
|
}
|
|
@ -30,9 +30,7 @@ local servers = {
|
||||||
|
|
||||||
for server_name, server in pairs(servers) do
|
for server_name, server in pairs(servers) do
|
||||||
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
||||||
require('lspconfig')[server_name].setup(server)
|
lspconfig[server_name].setup(server)
|
||||||
end
|
end
|
||||||
|
|
||||||
require('custom.plugins.lsp.clangd').setup()
|
|
||||||
|
|
||||||
return {}
|
return {}
|
Loading…
Reference in New Issue