Closed jdhao closed 12 months ago
If we use VeryLazy as event for both nvim-cmp and nvim-lspconfig, it seems that the nvim_lsp source for nvim-cmp can not be set properly with a high chance. The following patch can fix this:
VeryLazy
diff --git i/lua/plugins.lua w/lua/plugins.lua index 3cd2004..cd8667c 100644 --- i/lua/plugins.lua +++ w/lua/plugins.lua @@ -23,7 +23,7 @@ require("lazy").setup { -- auto-completion engine { "hrsh7th/nvim-cmp", - event = 'VeryLazy', + event = 'InsertEnter', dependencies = { "hrsh7th/cmp-nvim-lsp", "onsails/lspkind-nvim", @@ -40,7 +40,7 @@ require("lazy").setup { { "neovim/nvim-lspconfig", - event = 'VeryLazy', + event = { 'BufRead', 'BufNewFile' }, config = function() require("config.lsp") end,
If we use
VeryLazy
as event for both nvim-cmp and nvim-lspconfig, it seems that the nvim_lsp source for nvim-cmp can not be set properly with a high chance. The following patch can fix this: