Closed ChewingBever closed 1 month ago
cmp_nvim_lsp
depends on nvim-cmp
.
You need to add it as:
{'hrsh7th/nvim-cmp', config = function()
require('config.cmp')
end},
-- nvim-cmp sources require nvim-cmp since they depend on it in there plugin/
-- files
{ 'hrsh7th/cmp-nvim-lsp', requires = 'hrsh7th/nvim-cmp' },
{ 'hrsh7th/cmp-buffer', requires = 'hrsh7th/nvim-cmp' },
{ 'hrsh7th/cmp-path', requires = 'hrsh7th/nvim-cmp' },
{ 'hrsh7th/cmp-cmdline', requires = 'hrsh7th/nvim-cmp' },
nvim --version
:v0.10.0
git --version
:2.45.2
Steps to reproduce
Start neovim by requiring my plugins.lua file in the
init.lua
.Actual behaviour
Sometimes I get this error that pops up, after which none of my LSP-related features work. I can fix this by restarting neovim 1 or more times until it starts up without having the error pop up.
My theory for this is that Pckr does not import the plugins in any specific order. However, some of my plugins do use each either's module in their config, causing the
module 'cmp_nvim_lsp' not found
error if the plugin that requires it was loaded before thecmp_nvim_lsp
.I only started seeing this behavior after I migrated from Packer to Pckr recently.
Expected behaviour
For this error to not occur, and the plugin configs to load correctly.
pckr files
Plugin specification file(s)
``` local function bootstrap_pckr() local pckr_path = vim.fn.stdpath("data") .. "/pckr/pckr.nvim" if not vim.uv.fs_stat(pckr_path) then vim.fn.system({ 'git', 'clone', "--filter=blob:none", 'https://github.com/lewis6991/pckr.nvim', pckr_path }) end vim.opt.rtp:prepend(pckr_path) end bootstrap_pckr() require('pckr').add{ { "tpope/vim-fugitive", config = function() require('config.fugitive') end }, { "ctrlpvim/ctrlp.vim", config_pre = function() require('config.ctrlp') end }, "tpope/vim-commentary", { "preservim/nerdtree", config = function() require('config.nerdtree') end }, "jiangmiao/auto-pairs", "editorconfig/editorconfig-vim", { "marko-cerovac/material.nvim", config = function() vim.cmd("colorscheme material") -- color material nmap("