hrsh7th / nvim-cmp

A completion plugin for neovim coded in Lua.
MIT License
7.45k stars 370 forks source link

Neovim LSP autocompletes everything twice. #1870

Open mmkumr opened 3 months ago

mmkumr commented 3 months ago

FAQ

Announcement

Minimal reproducible full config

set nocompatible
syntax on

call plug#begin('~/.config/nvim/plugged')

Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/vim-vsnip'

call plug#end()

lua <<EOF
local cmp = require 'cmp'

cmp.setup {
  snippet = {
    expand = function(args)
      vim.fn['vsnip#anonymous'](args.body)
    end,
  },
  sources = {
    { name = 'buffer' },
    { name = 'vsnip' },
  },
}
EOF

Description

Neovim LSP autocompletes everything twice. image

Steps to reproduce

  1. Tried installing nvim-cmp with Plug and Lazy package managers.
  2. Tried removing all the snippets in the snippet file.
  3. Tried with other programming language like python. But this problem only occurs when code is autocompleted using the snippet provided by LSP.