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

LSP source can slow other sources #540

Closed
2 tasks done
ribru17 opened this issue Dec 13, 2024 · 2 comments
Closed
2 tasks done

LSP source can slow other sources #540

ribru17 opened this issue Dec 13, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@ribru17
Copy link

ribru17 commented Dec 13, 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

I have created a spell source for blink and while debugging it I noticed that the marksman LSP was slowing my completion results. When disabling the LSP source (or just running LspStop) there is a noticeable improvement

Screencast_20241213_103930.webm

PS thanks for the awesome plugin :)

Relevant configuration

sources = {
        default = { 'lsp', 'path', 'luasnip', 'spell' },
        providers = {
          spell = {
            name = 'Spell',
            module = 'blink-cmp-spell',
          },
        },
      },

neovim version

NVIM v0.11.0-dev Build type: Release LuaJIT 2.1.1713773202

blink.cmp version: branch, tag, or commit

2c826d9

@ribru17 ribru17 added the bug Something isn't working label Dec 13, 2024
@Saghen
Copy link
Owner

Saghen commented Dec 13, 2024

You could mark your LSP source as async so it doesn't block, perhaps conditionally

sources.providers.lsp.async = function()
  local clients = vim.lsp.get_clients({ bufnr = 0 })
  for _, client in ipairs(clients) do
    if client.name == 'marksman' then return true
  end
  return false
end

PS thanks for the awesome plugin :)

My pleasure :)

@ribru17
Copy link
Author

ribru17 commented Dec 13, 2024

Wonderful, that solves it. Thank you!

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

2 participants