blink.cmp icon indicating copy to clipboard operation
blink.cmp copied to clipboard

Unexpected Array Method Suggestions

Open ThomasCode92 opened this issue 5 months ago • 2 comments

Hi, I'm encountering a strange behavior in Neovim with TypeScript LSP (using Drizzle ORM) and blink.cmp.

Code Example

export async function getFolderById(folderId: number) {
  const folders = await db
    .select()
    .from(folderSchema)
    .where(eq(folderSchema.id, folderId));
  return folders[0];
}

The Problem

When I try to chain another method after .from—like Drizzle's .orderBy()—I'm also getting autocomplete suggestions for regular array methods like .sort(), .forEach(), etc. And as you can see in the screenshot, to formatting is also incorrect.

Image

However, if I remove the async keyword from the function declaration, those array methods no longer show up in the suggestions.

I tested the same code in VS Code and with nvim-cmp, and it behaves correctly there—no array method suggestions appear in this context.

Image

Questions

  • Is this an issue with blink.cmp or a deeper issue with how the LSP handles async context?
  • Why does removing async change the behavior of completion suggestions?
  • Any suggestions for debugging or resolving this?

Environment

Thanks in advance for any help!

ThomasCode92 avatar Jul 22 '25 06:07 ThomasCode92

Does nvim-cmp show the array methods in the list (.sort and so on) after only typing the . without any other characters?

saghen avatar Jul 23 '25 15:07 saghen

I've included a comparison table below between blink.cmp and nvim-cmp. These screenshots were taken after typing just a single . — the completion menu opens automatically in both cases:

blink.cmp nvim-cmp
Image Image

However, when I type something like sort (which should not be in the completion list) when using blink.cmp, the completion suggestion appear in the wrong position:

typing sort accepted sort
Image Image

ThomasCode92 avatar Jul 24 '25 05:07 ThomasCode92