supermaven-inc / supermaven-nvim

The official Neovim plugin for Supermaven
https://supermaven.com/
MIT License
742 stars 38 forks source link

Pain with cmp integration... #118

Open mzealey opened 1 week ago

mzealey commented 1 week ago

Not sure if it's an issue with supermaven or cmp but I'll start here... I've the following setup:

  require("lazy").setup({
      {
        "supermaven-inc/supermaven-nvim",
        config = function() 
          require("supermaven-nvim").setup({
            color = {
              suggestion_color = "#999999",
              cterm = 244,
            },
            disable_keymaps = true,
          })
        end,

      },

  cmp.setup({
    snippet = {
      expand = function(args)
        vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
      end,
    },
    mapping = cmp.mapping.preset.insert({
      ['<C-Space>'] = cmp.mapping.complete(),   
      ['<C-e>'] = cmp.mapping.abort(),
      ['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
      ['<Tab>'] = cmp.mapping.select_next_item(), 
    }),
    sources = cmp.config.sources({                                                                                                                                                 
      { name = 'supermaven', priority = 1 },
      { name = 'nvim_lsp', priority = 2, max_item_count = 15},
      { name = 'path', priority = 5, max_item_count = 10},
    }, {
      { name = 'buffer' },      
    })                          
  })                            

The way the (python) lsp and supermaven work together is not great - it's kind of like supermaven will pop up with the grey auto-complete text, but it won't appear in cmp, but then half the time it does. It feels like there's some race between lsp and supermaven whereby supermaven's result is getting nuked, but only sometimes. Any suggestions of how to debug this further would be appreciated.

AlejandroSuero commented 6 days ago

@mzealey this issue may be related if you want to check it out https://github.com/supermaven-inc/supermaven-nvim/issues/77