Skip to content

Commit

Permalink
fix bug in lsp handlers
Browse files Browse the repository at this point in the history
Signed-off-by: Micah Halter <micah@balena.io>
  • Loading branch information
mehalter committed Apr 10, 2022
1 parent 11ce851 commit 50f8841
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 3 additions & 5 deletions lua/configs/lsp/handlers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,11 @@ M.on_attach = function(client, bufnr)
lsp_highlight_document(client)
end

local capabilities = vim.lsp.protocol.make_client_capabilities()
M.capabilities = vim.lsp.protocol.make_client_capabilities()

local status_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
if not status_ok then
return
if status_ok then
M.capabilities = cmp_nvim_lsp.update_capabilities(M.capabilities)
end

M.capabilities = cmp_nvim_lsp.update_capabilities(capabilities)

return M
5 changes: 2 additions & 3 deletions lua/core/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ local astro_plugins = {
-- Completion engine
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
event = { "BufRead", "BufNewFile" },
config = function()
require("configs.cmp").config()
end,
Expand Down Expand Up @@ -206,7 +206,6 @@ local astro_plugins = {
-- LSP manager
{
"williamboman/nvim-lsp-installer",
event = { "BufRead", "BufNewFile" },
cmd = {
"LspInstall",
"LspInstallInfo",
Expand All @@ -222,7 +221,7 @@ local astro_plugins = {
-- Built-in LSP
{
"neovim/nvim-lspconfig",
event = "BufWinEnter",
after = "cmp-nvim-lsp",
config = function()
require "configs.lsp"
end,
Expand Down

0 comments on commit 50f8841

Please sign in to comment.