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

All LSPs refetched when one marks incomplete #921

Open
2 tasks done
mhanberg opened this issue Jan 6, 2025 · 6 comments
Open
2 tasks done

All LSPs refetched when one marks incomplete #921

mhanberg opened this issue Jan 6, 2025 · 6 comments
Labels
bug Something isn't working LSP Related to a specific LSP

Comments

@mhanberg
Copy link

mhanberg commented Jan 6, 2025

Make sure you have done the following

  • Updated to the latest version of blink.cmp
  • Searched for existing issues and documentation (try <C-k> on https://cmp.saghen.dev)

Bug Description

For an LSP (in this case, Next LS, an Elixir LSP), whenever i attempt to utilizing the fzf style matching (with typo resistance set to false), the completion window just closes. I see the letter I typed get bolded for a split second before the window closes.

In my nvim config, Lua LS completions seem to correctly fzf match and the window stays open. Same for cmdline completions in my Elixir project as well as nvim config.

Relevant configuration

{
      keymap = { preset = "default" },
      fuzzy = {
        use_typo_resistance = false,
        use_frecency = false,
        use_proximity = false,
      },
      completion = {
        list = {
          selection = "auto_insert",
        },
        menu = {
          border = "rounded",
        },
        accept = { auto_brackets = { enabled = false } },
        documentation = {
          window = {
            border = "rounded",
          },
          auto_show = true,
          auto_show_delay_ms = 0,
        },
      },
      appearance = {
        nerd_font_variant = "mono",
      },
      signature = { enabled = true },
      sources = {
        default = { "lsp", "path" },
        min_keyword_length = function(ctx)
          if ctx.mode == "cmdline" and string.find(ctx.line, " ") == nil then
            return 2
          end
          return 0
        end,
      },
    },
    opts_extend = { "sources.default" },
  }

neovim version

0.10.3

blink.cmp version

0.9.2

@mhanberg mhanberg added the bug Something isn't working label Jan 6, 2025
@mhanberg
Copy link
Author

mhanberg commented Jan 6, 2025

I am the author of this LSP (Next LS), I am wondering if there is some property in the completion item you are using to filter than perhaps I am not sending down?

@Saghen
Copy link
Owner

Saghen commented Jan 6, 2025

Are you filtering on the LSP side before sending? We'll immediately fuzzy match and show the result, but if the LSP sends isIncomplete == true, we'll asynchronously make a request to update the list. That sounds like it would be why your results momentarily show it's matching correctly

I am wondering if there is some property in the completion item you are using to filter than perhaps I am not sending down

We filter on filterText and fallback to label if it's nil

@Saghen Saghen added the LSP Related to a specific LSP label Jan 6, 2025
@mhanberg
Copy link
Author

mhanberg commented Jan 6, 2025

Are you filtering on the LSP side before sending?

No.

It does not set is incomplete to true, and only provides the label property, not the filterText property.

I'll investigate further.

@mhanberg
Copy link
Author

mhanberg commented Jan 6, 2025

I have observed that nvim is making a new textDocument/completion request on every keystroke, which seems suspicious.

@Saghen
Copy link
Owner

Saghen commented Jan 6, 2025

@mikavilpas You also mentioned this in #870, but I can't seem to reproduce it. Could either of you provide a repro.lua?

Edit: Ah just reproduced it with the Lua LSP, never mind folks

Edit 2: Scratch that, it seems to be working as expected. Do you folks have multiple LSPs enabled? If so, which ones?

@mhanberg
Copy link
Author

mhanberg commented Jan 6, 2025

Oh, interesting.

I also had tailwindcss lsp enabled for the elixir buffers.

I disabled that and now its working as expected

@Saghen Saghen changed the title Completion window closes when attempting to fzf style match All LSPs refetched when one marks incomplete Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working LSP Related to a specific LSP
Projects
None yet
Development

No branches or pull requests

2 participants