Skip to content

[audit] blink.build():pwait() — verify method exists in blink.cmp v2 public API #298

Description

@stanfish06

What

lua/config/plugin_config.lua calls blink.build():pwait() in two places (lines 85 and 253). The .pwait() method is not documented in the blink.cmp README and may not exist on the object returned by build().

Where

  • lua/config/plugin_config.lua:85 — initial build path (runs on startup if native lib is missing)
  • lua/config/plugin_config.lua:253PackChanged callback (runs after vim.pack install/update)
-- line 85
blink.build():pwait()

-- line 253
require("blink.cmp").build({ force = kind == "update" }):pwait()

Why it matters

Both call sites are wrapped in pcall, so a missing .pwait method won't crash Neovim. However, it means the build silently fails on every startup until the native fuzzy library is installed some other way. The vim.log.levels.WARN notification fires, but the root cause (wrong method name rather than missing rustc) is hidden.

In blink.cmp v1 the build mechanism was entirely different. In the current v2 API, build() appears to return an async promise-like object. Common Lua async libraries use :wait(), not :pwait(). The p prefix is unusual and may be a typo or leftover from an earlier version of blink.cmp's internal API.

Recommended action

  1. Check the blink.cmp v2 source for what build() returns and whether .pwait() or .wait() is the correct method.
  2. If .pwait() doesn't exist, replace with the correct method (likely :wait()).
  3. Add a guard: if type(obj.pwait) == "function" then obj:pwait() elseif type(obj.wait) == "function" then obj:wait() end as a transitional shim if the API is still in flux.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions