Compare commits

..

2 Commits

View File

@ -82,44 +82,50 @@ return {
}, },
config = function() config = function()
local lspconfig_default_opts = { local capabilities = vim.tbl_deep_extend(
-- Broadcast full client capabilities to language servers 'force', vim.lsp.protocol.make_client_capabilities(),
capabilities = vim.tbl_deep_extend( require('cmp_nvim_lsp').default_capabilities())
'force', vim.lsp.protocol.make_client_capabilities(),
require('cmp_nvim_lsp').default_capabilities()),
}
require('mason').setup() local server_opts = {
require('mason-lspconfig').setup({ clangd = {
automatic_installation = false, cmd = { 'clangd', '--completion-style=detailed' },
ensure_installed = ensure_installed, },
})
vim.lsp.config('clangd', { lua_ls = {
cmd = { 'clangd', '--completion-style=detailed' }, settings = {
}) Lua = {
diagnostics = {
vim.lsp.config('lua_ls', { disable = { 'missing-fields', },
settings = { globals = { 'vim', },
Lua = { },
diagnostics = {
disable = { 'missing-fields', },
globals = { 'vim', },
}, },
}, },
}, },
})
vim.lsp.config('pyright', { pyright = {
settings = { settings = {
pyright = { pyright = {
disableOrganizeImports = true, disableOrganizeImports = true,
},
}, },
}, },
})
vim.lsp.config('harper_ls', { 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.
@ -173,7 +179,7 @@ return {
}, },
formatting = { formatting = {
format = function(entry, vim_item) format = function(_, 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)
@ -191,7 +197,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({})