removed additional braces
This commit is contained in:
parent
df0db24702
commit
946c9a8a85
@ -31,64 +31,62 @@ local lspKeys = function(client, bufnr)
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'SmiteshP/nvim-navic',
|
||||
},
|
||||
lazy = false,
|
||||
config = function()
|
||||
local servers = {
|
||||
'basedpyright',
|
||||
'ruff',
|
||||
'clangd',
|
||||
'lua_ls',
|
||||
'jsonls',
|
||||
'dockerls',
|
||||
'yamlls',
|
||||
'neocmake',
|
||||
'markdown_oxide',
|
||||
'taplo',
|
||||
}
|
||||
|
||||
require('mason').setup()
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = servers,
|
||||
})
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||
vim.lsp.config('*', {
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
vim.lsp.enable(servers)
|
||||
|
||||
local lsp_group = vim.api.nvim_create_augroup('UserLspAttach', { clear = true })
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = lsp_group,
|
||||
desc = 'Set buffer‑local keymaps and options after an LSP client attaches',
|
||||
callback = function(args)
|
||||
local bufnr = args.buf
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
if not client then
|
||||
return
|
||||
end
|
||||
lspKeys(client, bufnr)
|
||||
|
||||
if client.server_capabilities.completionProvider then
|
||||
vim.bo[bufnr].omnifunc = 'v:lua.vim.lsp.omnifunc'
|
||||
vim.bo[bufnr].formatexpr = 'v:lua.vim.lsp.formatexpr()'
|
||||
end
|
||||
|
||||
if client.server_capabilities.documentSymbolProvider then
|
||||
local navic = require('nvim-navic')
|
||||
navic.attach(client, bufnr)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'SmiteshP/nvim-navic',
|
||||
},
|
||||
lazy = false,
|
||||
config = function()
|
||||
local servers = {
|
||||
'basedpyright',
|
||||
'ruff',
|
||||
'clangd',
|
||||
'lua_ls',
|
||||
'jsonls',
|
||||
'dockerls',
|
||||
'yamlls',
|
||||
'neocmake',
|
||||
'markdown_oxide',
|
||||
'taplo',
|
||||
}
|
||||
|
||||
require('mason').setup()
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = servers,
|
||||
})
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||
vim.lsp.config('*', {
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
vim.lsp.enable(servers)
|
||||
|
||||
local lsp_group = vim.api.nvim_create_augroup('UserLspAttach', { clear = true })
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = lsp_group,
|
||||
desc = 'Set buffer‑local keymaps and options after an LSP client attaches',
|
||||
callback = function(args)
|
||||
local bufnr = args.buf
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
if not client then
|
||||
return
|
||||
end
|
||||
lspKeys(client, bufnr)
|
||||
|
||||
if client.server_capabilities.completionProvider then
|
||||
vim.bo[bufnr].omnifunc = 'v:lua.vim.lsp.omnifunc'
|
||||
vim.bo[bufnr].formatexpr = 'v:lua.vim.lsp.formatexpr()'
|
||||
end
|
||||
|
||||
if client.server_capabilities.documentSymbolProvider then
|
||||
local navic = require('nvim-navic')
|
||||
navic.attach(client, bufnr)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user