saadparwaiz1 / cmp_luasnip

luasnip completion source for nvim-cmp
Apache License 2.0
683 stars 32 forks source link

module 'cmp' not found #56

Open Rohith-JN opened 1 year ago

Rohith-JN commented 1 year ago

I am getting this error when I try to install cmp_luasnip

Error

Using packer:

use({ "L3MON4D3/LuaSnip" })

-- auto-completion engine
use({
    "hrsh7th/nvim-cmp",
    config = [[require('config.nvim-cmp')]],
    after = "lspkind-nvim",
    requires = {
        "saadparwaiz1/cmp_luasnip",
        "hrsh7th/cmp-nvim-lua",
        "hrsh7th/cmp-nvim-lsp",
        "hrsh7th/cmp-path",
        "hrsh7th/cmp-buffer",
        "hrsh7th/cmp-omni",
    },
})

use({ "saadparwaiz1/cmp_luasnip" })

use({
    "hrsh7th/cmp-nvim-lua",
    after = "cmp_luasnip",
})

-- nvim-cmp completion sources
use({ "hrsh7th/cmp-nvim-lsp", after = "nvim-cmp" })
use({ "hrsh7th/cmp-path", after = "nvim-cmp" })
use({ "hrsh7th/cmp-buffer", after = "nvim-cmp" })
use({ "hrsh7th/cmp-omni", after = "nvim-cmp" })

Here is my nvim-config

TornaxO7 commented 1 year ago

Try removing those lines:

use({ "saadparwaiz1/cmp_luasnip" })

use({
    "hrsh7th/cmp-nvim-lua",
    after = "cmp_luasnip",
})

-- nvim-cmp completion sources
use({ "hrsh7th/cmp-nvim-lsp", after = "nvim-cmp" })
use({ "hrsh7th/cmp-path", after = "nvim-cmp" })
use({ "hrsh7th/cmp-buffer", after = "nvim-cmp" })
use({ "hrsh7th/cmp-omni", after = "nvim-cmp" })
Rohith-JN commented 1 year ago

The error persists

L3MON4D3 commented 1 year ago

Maybe packer needs the full plugin-name in after? And/Or the after-directive has to be added to cmp_luasnip too? Try copy-pasting someone elses setup and see if it works/what changes make it no longer work (Also, I suspect this is some error with packer, maybe look in their issues)

Rohith-JN commented 1 year ago

@L3MON4D3 I tried switching configs and also modified the order of plugins, nothing worked. Maybe it is a packer issue