local nvim_lsp = require 'lspconfig'
local on_attach = function(client, bufnr)
-- LSP Settings
-- ....
-- [Plug] completion-nvim
require'completion_nvim'.on_attach()
end
-- Use a loop to conveniently both setup defined servers
-- and map buffer local keybindings when the language server attaches
local servers_settings = {
gopls = {},
vimls = {},
}
for lsp, settings in pairs(servers_settings) do
settings['on_attach'] = on_attach
nvim_lsp[lsp].setup(settings)
end
How to reproduce
Let LSP and completion-nvim load on all filetypes. And just open the nvim.
And the nvim will print an error message:
Error detected while processing $HOME/.local/share/CrowsEnv/dots/nvim/init.lua:
E5113: Error while calling lua chunk: ...ite/pack/packer/start/completion-nvim/lua/completion.lua:251: bad argument #1 to 'ipairs' (tab
le expected, got nil)
My testing minimal init.vim
local nvim_lsp = require 'lspconfig'
How to reproduce Let LSP and completion-nvim load on all filetypes. And just open the nvim. And the nvim will print an error message:
Expected behavior on error message print.