Coder Social home page Coder Social logo

Comments (7)

saadparwaiz1 avatar saadparwaiz1 commented on June 12, 2024 1

Thank you for letting me know :)

from cmp_luasnip.

saadparwaiz1 avatar saadparwaiz1 commented on June 12, 2024

Hi yes I'll look into it :)

@xeluxee could you provide a minimal vimrc to trigger the issue?

from cmp_luasnip.

saadparwaiz1 avatar saadparwaiz1 commented on June 12, 2024

I can't reproduce here's the screenshot of both for snippets showing up
Screenshot 2021-09-16 at 18 41 41

from cmp_luasnip.

saadparwaiz1 avatar saadparwaiz1 commented on June 12, 2024

Here's the minimal config I tried. Can you reproduce with this config?

vim.cmd [[packadd packer.nvim]]

require('packer').startup(function()
	use 'wbthomason/packer.nvim'
	use {
		'L3MON4D3/LuaSnip',
		requires = {
			'rafamadriz/friendly-snippets'
		}
	}
	use {
		'hrsh7th/nvim-cmp',
		requires = {
			'hrsh7th/cmp-nvim-lsp',
			'saadparwaiz1/cmp_luasnip'
		}
	}

	use {
		'neovim/nvim-lspconfig'
	}
end)

require('luasnip').config.setup({})
require('luasnip.loaders.from_vscode').load()


local cmp = require('cmp')
cmp.setup {
	snippet = {
		expand = function(args)
			require'luasnip'.lsp_expand(args.body)
		end
	},
	sources = {
		{ name = 'luasnip' },
		{ name = 'nvim_lsp'},
	},
	mapping = {
	  ['<C-d>'] = cmp.mapping.scroll_docs(-4),
	  ['<C-f>'] = cmp.mapping.scroll_docs(4),
	  ['<C-Space>'] = cmp.mapping.complete(),
	  ['<C-e>'] = cmp.mapping.close(),
	  ['<CR>'] = cmp.mapping.confirm({
	    behavior = cmp.ConfirmBehavior.Replace,
	    select = true,
	  })
	}
}

local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)

require'lspconfig'.clangd.setup {
  capabilities = capabilities,
}

from cmp_luasnip.

xeluxee avatar xeluxee commented on June 12, 2024

I tried your minimal config and I can't reproduce this issue with your config
Maybe it's a problem with my config...
I'll investigate and I'll let you know

from cmp_luasnip.

saadparwaiz1 avatar saadparwaiz1 commented on June 12, 2024

@xeluxee sounds good :)

from cmp_luasnip.

xeluxee avatar xeluxee commented on June 12, 2024

Just discovered that this issue was caused by dup setting in vim.CompletedItem variable
I'm trying LunarVim so I didn't know about this setting that was already present there.
Setting dup to 1 makes everything fine.

Sorry for wasting time

from cmp_luasnip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.