Compare commits
2 Commits
00f87db692
...
53d9b50e0b
Author | SHA1 | Date | |
---|---|---|---|
53d9b50e0b | |||
4f38790589 |
@ -82,44 +82,50 @@ return {
|
||||
},
|
||||
|
||||
config = function()
|
||||
local lspconfig_default_opts = {
|
||||
-- Broadcast full client capabilities to language servers
|
||||
capabilities = vim.tbl_deep_extend(
|
||||
'force', vim.lsp.protocol.make_client_capabilities(),
|
||||
require('cmp_nvim_lsp').default_capabilities()),
|
||||
}
|
||||
local capabilities = vim.tbl_deep_extend(
|
||||
'force', vim.lsp.protocol.make_client_capabilities(),
|
||||
require('cmp_nvim_lsp').default_capabilities())
|
||||
|
||||
require('mason').setup()
|
||||
require('mason-lspconfig').setup({
|
||||
automatic_installation = false,
|
||||
ensure_installed = ensure_installed,
|
||||
})
|
||||
local server_opts = {
|
||||
clangd = {
|
||||
cmd = { 'clangd', '--completion-style=detailed' },
|
||||
},
|
||||
|
||||
vim.lsp.config('clangd', {
|
||||
cmd = { 'clangd', '--completion-style=detailed' },
|
||||
})
|
||||
|
||||
vim.lsp.config('lua_ls', {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
disable = { 'missing-fields', },
|
||||
globals = { 'vim', },
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
disable = { 'missing-fields', },
|
||||
globals = { 'vim', },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.config('pyright', {
|
||||
settings = {
|
||||
pyright = {
|
||||
disableOrganizeImports = true,
|
||||
pyright = {
|
||||
settings = {
|
||||
pyright = {
|
||||
disableOrganizeImports = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.config('harper_ls', {
|
||||
filetypes = {}, -- Disable for all filetypes
|
||||
harper_ls = {
|
||||
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.
|
||||
@ -173,7 +179,7 @@ return {
|
||||
},
|
||||
|
||||
formatting = {
|
||||
format = function(entry, vim_item)
|
||||
format = function(_, vim_item)
|
||||
-- Set a limit to how wide the completion menu can be
|
||||
local winwidth = vim.fn.winwidth(vim.api.nvim_get_current_win())
|
||||
local menuwidth = math.min(winwidth / 2, 70)
|
||||
@ -191,7 +197,7 @@ return {
|
||||
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({})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user