Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.7.1 makes neovim quit #431

Closed
2 tasks done
gogamid opened this issue Dec 3, 2024 · 6 comments
Closed
2 tasks done

v0.7.1 makes neovim quit #431

gogamid opened this issue Dec 3, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@gogamid
Copy link

gogamid commented Dec 3, 2024

Make sure you have done the following

  • I have updated to the latest version of blink.cmp
  • I have read the README

Bug Description

neovim quits after the new changes in the blink completion. I get first

position_encoding param is required in vim.lsp.util.make_range_params. Defaulting to position encoding of the first client.

then whenever i type something, neovim quits.

Has anyone experienced this?

Relevant configuration

return {
  {
    "hrsh7th/nvim-cmp",
    enabled = false,
  },
  {
    "saghen/blink.cmp",
    version = not vim.g.lazyvim_blink_main and "*",
    build = vim.g.lazyvim_blink_main and "cargo build --release",
    opts_extend = {
      "sources.completion.enabled_providers",
      "sources.compat",
    },
    dependencies = {
      "rafamadriz/friendly-snippets",
      -- add blink.compat to dependencies
      {
        "saghen/blink.compat",
        optional = true, -- make optional so it's only enabled if any extras need it
        opts = {},
        version = not vim.g.lazyvim_blink_main and "*",
      },
    },
    event = "InsertEnter",

    ---@module 'blink.cmp'
    ---@type blink.cmp.Config
    opts = {
      highlight = {
        -- sets the fallback highlight groups to nvim-cmp's highlight groups
        -- useful for when your theme doesn't support blink.cmp
        -- will be removed in a future release, assuming themes add support
        use_nvim_cmp_as_default = false,
      },
      -- set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
      -- adjusts spacing to ensure icons are aligned
      nerd_font_variant = "mono",
      completion = {
        menu = {
          winblend = vim.o.pumblend,
          draw = { treesitter = true },
        },
        documentation = {
          auto_show = true,
          auto_show_delay_ms = 200,
        },
        ghost_text = {
          enabled = vim.g.ai_cmp,
        },
      },

      -- experimental auto-brackets support
      accept = { auto_brackets = { enabled = true } },

      -- experimental signature help support
      -- trigger = { signature_help = { enabled = true } }
      sources = {
        -- adding any nvim-cmp sources here will enable them
        -- with blink.compat
        compat = {},
        completion = {
          -- remember to enable your providers here
          enabled_providers = { "lsp", "path", "snippets", "buffer" },
        },
      },

      keymap = {
        preset = "enter",
        ["<Tab>"] = {
          LazyVim.cmp.map({ "snippet_forward", "ai_accept" }),
          "fallback",
        },
      },
    },
    ---@param opts blink.cmp.Config | { sources: { compat: string[] } }
    config = function(_, opts)
      -- setup compat sources
      local enabled = opts.sources.completion.enabled_providers
      for _, source in ipairs(opts.sources.compat or {}) do
        opts.sources.providers[source] = vim.tbl_deep_extend(
          "force",
          { name = source, module = "blink.compat.source" },
          opts.sources.providers[source] or {}
        )
        if type(enabled) == "table" and not vim.tbl_contains(enabled, source) then
          table.insert(enabled, source)
        end
      end
      require("blink.cmp").setup(opts)
    end,
  },

  -- add icons
  {
    "saghen/blink.cmp",
    opts = function(_, opts)
      opts.appearance = opts.appearance or {}
      opts.appearance.kind_icons = LazyVim.config.icons.kinds
    end,
  },

  -- lazydev
  {
    "saghen/blink.cmp",
    opts = {
      sources = {
        completion = {
          -- add lazydev to your completion providers
          enabled_providers = { "lazydev" },
        },
        providers = {
          lsp = {
            -- dont show LuaLS require statements when lazydev has items
            fallback_for = { "lazydev" },
          },
          lazydev = {
            name = "LazyDev",
            module = "lazydev.integrations.blink",
          },
        },
      },
    },
  },
  -- catppuccin support
  {
    "catppuccin",
    optional = true,
    opts = {
      integrations = { blink_cmp = true },
    },
  },
}

neovim version

v0.11.0-dev-1272+g3d3a99e69c-Homebrew

blink.cmp version: branch, tag, or commit

v0.7.1

@gogamid gogamid added the bug Something isn't working label Dec 3, 2024
@benfrain
Copy link

benfrain commented Dec 3, 2024

Related, also on 0.7.1, when I type v it quits Neovim and creates a new Terminal window below (using Kitty 0.37, Neovim 10.2, macOS 15.1.1).

@gogamid
Copy link
Author

gogamid commented Dec 3, 2024

off topic, love your videos @benfrain :D

@benfrain
Copy link

benfrain commented Dec 3, 2024

off topic, love your videos @benfrain :D

Oh, thanks so much 🙏 Last one featured blink.cmp so not totally off topic 🤣

@Saghen
Copy link
Owner

Saghen commented Dec 3, 2024

Does re-installing fix the issue as per #68? If it does, and you're able to reproduce this issue, please lmk! I've been trying to reproduce this bug for ages

@benfrain
Copy link

benfrain commented Dec 3, 2024

Does re-installing fix the issue as per #68? If it does, and you're able to reproduce this issue, please lmk! I've been trying to reproduce this bug for ages

Ha, for me, yes, 'turning it off and back on again' did the trick!

@Saghen Saghen closed this as not planned Won't fix, can't repro, duplicate, stale Dec 3, 2024
@Saghen
Copy link
Owner

Saghen commented Dec 3, 2024

Duplicate of #68

@Saghen Saghen marked this as a duplicate of #68 Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants