Description
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
I just migrated to blink.nvim, thanks for the project, it's great!
I was trying the signature
feature and encountered and interesting behavior on JS files. When I'm on a lua file, the signature shows up correctly after I accept and autocomplete suggestion. But when I'm on a JS file (with the ts_ls
lsp), the signature help window doesn't appear directly when I accept an autocomplete suggestion.
I'm not so sure why it's happening. But it seems like it's starting to work either:
- When I type a trigger character like
,
. - When I delete the parentheses and type them back again.
I also captured a screen recording to show the current behavior I'm seeing. This is a simple test.js
file in an empty directory that I added for this test:
blink-signature-issue.mov
As you can see, on both cases, when I accept the suggestion, it doesn't show me anything.
I did some printf debugging, and noticed that in Lua, we are triggering this through this if branch:
blink.cmp/lua/blink/cmp/signature/trigger.lua
Lines 76 to 77 in f2e4f6a
But in JS, we are not entering inside of this if branch because trigger.context
is nil
. I'm not so sure yet why this is the case though. I'm not familiar with the code.
If you have any pointers into how to debug this issue, I'm happy to help.
Also, here's a repro.lua file for this one:
-- Run with `nvim -u repro.lua`
vim.env.LAZY_STDPATH = '.repro'
load(vim.fn.system('curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua'))()
---@diagnostic disable-next-line: missing-fields
require('lazy.minit').repro({
spec = {
{
'saghen/blink.cmp',
-- please test on `main` if possible
-- otherwise, remove this line and set `version = '*'`
build = 'cargo build --release',
opts = {
signature = { enabled = true },
},
},
{
'neovim/nvim-lspconfig',
opts = {
servers = {
ts_ls = {},
},
},
config = function(_, opts)
local lspconfig = require('lspconfig')
for server, config in pairs(opts.servers) do
-- passing config.capabilities to blink.cmp merges with the capabilities in your
-- `opts[server].capabilities, if you've defined it
config.capabilities = require('blink.cmp').get_lsp_capabilities()
lspconfig[server].setup(config)
end
end,
},
},
})
typescript language server needs to be installed for this. You can do it with npm install -g typescript typescript-language-server
.
Relevant configuration
signature = { enabled = true }
neovim
version
v0.11.0
blink.cmp
version
Current main branch, f2e4f6a