@@ -3,8 +3,23 @@ return {
33 build = " cargo +nightly build --release" ,
44 opts = function (_ , opts )
55 opts .sources = opts .sources or {}
6- opts .sources .compat = opts .sources .compat or {}
7- table.insert (opts .sources .compat , " copilot" )
6+ opts .sources .providers = opts .sources .providers or {}
7+ opts .sources .providers .copilot = opts .sources .providers .copilot or {}
8+
9+ opts .sources .providers .copilot = {
10+ transform_items = function (_ , items )
11+ local CompletionItemKind = require (" blink.cmp.types" ).CompletionItemKind
12+ local kind_idx = # CompletionItemKind + 1
13+ CompletionItemKind [kind_idx ] = " Copilot"
14+ for _ , item in ipairs (items ) do
15+ item .kind = kind_idx
16+ end
17+ return items
18+ end ,
19+ }
20+
21+ -- opts.sources.compat = opts.sources.compat or {}
22+ -- table.insert(opts.sources.compat, "copilot")
823
924 -- Configure completion behavior
1025 opts .completion = opts .completion or {}
@@ -17,6 +32,44 @@ return {
1732 opts .keymap [" <S-Tab>" ] = { " select_prev" , " snippet_backward" , " fallback" }
1833 opts .keymap [" <C-Space>" ] = { " accept" , " fallback" }
1934
35+ opts .appearance = opts .appearance or {}
36+ opts .appearance = {
37+ -- Blink does not expose its default kind icons so you must copy them all (or set your custom ones) and add Copilot
38+ kind_icons = {
39+ Copilot = " " ,
40+ Text = " " ,
41+ Method = " " ,
42+ Function = " " ,
43+ Constructor = " " ,
44+
45+ Field = " " ,
46+ Variable = " " ,
47+ Property = " " ,
48+
49+ Class = " " ,
50+ Interface = " " ,
51+ Struct = " " ,
52+ Module = " " ,
53+
54+ Unit = " " ,
55+ Value = " " ,
56+ Enum = " " ,
57+ EnumMember = " " ,
58+
59+ Keyword = " " ,
60+ Constant = " " ,
61+
62+ Snippet = " " ,
63+ Color = " " ,
64+ File = " " ,
65+ Reference = " " ,
66+ Folder = " " ,
67+ Event = " " ,
68+ Operator = " " ,
69+ TypeParameter = " " ,
70+ },
71+ }
72+
2073 return opts
2174 end ,
2275}
0 commit comments