You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to get GitHub Copilot to work with blink.cmp. I'm using the blink-cmp-copilot plugin and followed the setup in the readme. I installed Copilot via copilot.lua and created an autocmp.lua script that configures blink to use copilot. However, typing in a source file, copilot suggestions don't show in the drop-down and I only see suggestions from LSP servers. Here is the content of autocmp.lua script:
return {
{
"saghen/blink.cmp",
dependencies= {
"L3MON4D3/LuaSnip", -- For snippet expansion (if needed)-- Add any additional dependencies as recommended in the blink.cmp docs.
{
"fang2hou/blink-copilot",
opts= {
max_completions=3,
max_attempts=4,
kind="Copilot",
debounce=750, ---@typeinteger | falseauto_refresh= {
backward=true,
forward=true,
},
},
},
},
config=function()
require("blink.cmp").setup({
-- You can configure general settings here.-- For example, the documentation shows configuration of snippet expansion,-- key mappings, and source registration.keymap= {
-- set to 'none' to disable the 'default' presetpreset="none",
["<C-space>"] = { "show", "show_documentation", "hide_documentation" },
["<C-e>"] = { "hide", "fallback" },
["<CR>"] = { "accept", "fallback" },
["<Up>"] = { "select_prev", "fallback" },
["<Down>"] = { "select_next", "fallback" },
["<S-Tab>"] = { "select_prev", "fallback" },
--["<Tab>"] = { "select_next", "fallback" },
["<Tab>"] = {
function(cmp)
localcompletion_list=require("blink.cmp.completion.list")
vim.schedule(function()
completion_list.accept({
index=completion_list.selected_item_idxor1,
})
end)
returntrueend,
},
["<C-b>"] = { "scroll_documentation_up", "fallback" },
["<C-d>"] = { "scroll_documentation_down", "fallback" },
["<C-k>"] = { "show_signature", "hide_signature", "fallback" },
},
completion= {
menu= {
auto_show=function(ctx)
returnctx.mode~="cmdline" ornotvim.tbl_contains({ "/", "?" }, vim.fn.getcmdtype())
end,
},
},
})
end,
opts= {
sources= {
default= { "lsp", "path", "snippets", "buffer", "copilot" },
providers= {
copilot= {
name="copilot",
module="blink-cmp-copilot",
score_offset=100,
async=true,
opts= {
max_completions=3,
},
transform_items=function(_, items)
localCompletionItemKind=require("blink.cmp.types").CompletionItemKindlocalkind_idx=#CompletionItemKind+1CompletionItemKind[kind_idx] ="Copilot"for_, iteminipairs(items) doitem.kind=kind_idxendreturnitemsend,
},
},
},
},
appearance= {
-- Blink does not expose its default kind icons so you must copy them all (or set your custom ones) and add Copilotkind_icons= {
Copilot="",
Text="",
Method="",
Function="",
Constructor="",
Field="",
Variable="",
Property="",
Class="",
Interface="",
Struct="",
Module="",
Unit="",
Value="",
Enum="",
EnumMember="",
Keyword="",
Constant="",
Snippet="",
Color="",
File="",
Reference="",
Folder="",
Event="",
Operator="",
TypeParameter="",
},
},
},
{
"neovim/nvim-lspconfig",
dependencies= {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"saghen/blink.cmp",
},
config=function()
locallsp=require("lspconfig")
localblink_cmp=require("blink.cmp").get_lsp_capabilities()
lsp.pylsp.setup({
capabilities=blink_cmp,
})
end,
},
}
As suggested in blink-cmp-copilot readme, I disabled copilot.lua's suggestion and panel modules. I also added copilot as a source to blink-cmp. However, I can't get copilot suggestions to show up in autocomplete window. How can I fix this? Thanks.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I'm trying to get GitHub Copilot to work with blink.cmp. I'm using the blink-cmp-copilot plugin and followed the setup in the readme. I installed Copilot via copilot.lua and created an
autocmp.lua
script that configuresblink
to use copilot. However, typing in a source file, copilot suggestions don't show in the drop-down and I only see suggestions from LSP servers. Here is the content ofautocmp.lua
script:As suggested in
blink-cmp-copilot
readme, I disabled copilot.lua's suggestion and panel modules. I also addedcopilot
as a source toblink-cmp
. However, I can't get copilot suggestions to show up in autocomplete window. How can I fix this? Thanks.Beta Was this translation helpful? Give feedback.
All reactions