Compare commits

..

No commits in common. "53d9b50e0bbc7b8512ad898604d64926ca16a538" and "00f87db6923c696b7d561a5f817aed0dcf3dc48c" have entirely different histories.

View File

@ -82,16 +82,24 @@ return {
}, },
config = function() config = function()
local capabilities = vim.tbl_deep_extend( local lspconfig_default_opts = {
-- Broadcast full client capabilities to language servers
capabilities = vim.tbl_deep_extend(
'force', vim.lsp.protocol.make_client_capabilities(), 'force', vim.lsp.protocol.make_client_capabilities(),
require('cmp_nvim_lsp').default_capabilities()) require('cmp_nvim_lsp').default_capabilities()),
}
local server_opts = { require('mason').setup()
clangd = { require('mason-lspconfig').setup({
automatic_installation = false,
ensure_installed = ensure_installed,
})
vim.lsp.config('clangd', {
cmd = { 'clangd', '--completion-style=detailed' }, cmd = { 'clangd', '--completion-style=detailed' },
}, })
lua_ls = { vim.lsp.config('lua_ls', {
settings = { settings = {
Lua = { Lua = {
diagnostics = { diagnostics = {
@ -100,32 +108,18 @@ return {
}, },
}, },
}, },
}, })
pyright = { vim.lsp.config('pyright', {
settings = { settings = {
pyright = { pyright = {
disableOrganizeImports = true, disableOrganizeImports = true,
}, },
}, },
}, })
harper_ls = { vim.lsp.config('harper_ls', {
filetypes = {}, -- Disable for all filetypes filetypes = {}, -- Disable for all filetypes
},
}
for server, opts in pairs(server_opts) do
-- Broadcast full client capabilities to language servers
opts.capabilities = vim.tbl_deep_extend(
'force', {}, capabilities, opts.capabilities or {})
vim.lsp.config(server, opts)
end
require('mason').setup()
require('mason-lspconfig').setup({
automatic_enable = true,
ensure_installed = ensure_installed,
}) })
-- (Dis|en)able harper-ls when spell mode is (dis|en)enabled. -- (Dis|en)able harper-ls when spell mode is (dis|en)enabled.
@ -179,7 +173,7 @@ return {
}, },
formatting = { formatting = {
format = function(_, vim_item) format = function(entry, vim_item)
-- Set a limit to how wide the completion menu can be -- Set a limit to how wide the completion menu can be
local winwidth = vim.fn.winwidth(vim.api.nvim_get_current_win()) local winwidth = vim.fn.winwidth(vim.api.nvim_get_current_win())
local menuwidth = math.min(winwidth / 2, 70) local menuwidth = math.min(winwidth / 2, 70)
@ -197,7 +191,7 @@ return {
documentation = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(),
}, },
preselect = 'None', -- Don't preselect completions suggested by source preselect = 'none', -- Don't preselect completions suggested by source
}) })
require("cmp_git").setup({}) require("cmp_git").setup({})