refactor lsp

This commit is contained in:
dlond 2025-05-29 21:24:30 +12:00
parent b48c2e9acf
commit 68450346a1
4 changed files with 13 additions and 8 deletions

View File

@ -949,7 +949,7 @@ require('lazy').setup({
-- 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.
{ import = 'custom.plugins' },
-- { import = 'custom.plugins' },
--
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
-- Or use telescope!

View File

@ -1,8 +1,6 @@
local M = {}
local lspconfig = require 'lspconfig'
local capabilities = require('blink.cmp').get_lsp_capabilities()
local Path = require 'plenary.path'
-- local Path = require 'plenary.path'
local pickers = require 'telescope.pickers'
local finders = require 'telescope.finders'
local conf = require('telescope.config').values
@ -50,6 +48,9 @@ function M.pick_target()
end
function M.setup()
local lspconfig = require 'lspconfig'
local capabilities = require('blink.cmp').get_lsp_capabilities()
lspconfig.clangd.setup {
cmd = make_clangd_cmd(),
filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda' },
@ -59,4 +60,6 @@ function M.setup()
}
end
return M
M.setup()
return {}

View File

@ -0,0 +1,4 @@
return {
require 'custom.plugins.lsp.lsp',
require 'custom.plugins.lsp.clangd',
}

View File

@ -30,9 +30,7 @@ local servers = {
for server_name, server in pairs(servers) do
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
require('lspconfig')[server_name].setup(server)
lspconfig[server_name].setup(server)
end
require('custom.plugins.lsp.clangd').setup()
return {}