Skip to content

Commit fd32689

Browse files
committed
feat: accept and auto brackets config
1 parent 443a9ea commit fd32689

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

lua/blink/cmp/config.lua

+37-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@
1010
--- @field snippet_forward string | string[]
1111
--- @field snippet_backward string | string[]
1212

13+
--- @class blink.cmp.AcceptConfig
14+
--- @field auto_brackets blink.cmp.AutoBracketsConfig
15+
16+
--- @class blink.cmp.AutoBracketsConfig
17+
--- @field enabled boolean
18+
--- @field default_brackets string[]
19+
--- @field override_brackets_for_filetypes table<string, string[] | function(item: blink.cmp.CompletionItem): string[]>
20+
--- @field force_allow_filetypes string[] Overrides the default blocked filetypes
21+
--- @field blocked_filetypes string[]
22+
--- @field kind_resolution blink.cmp.AutoBracketResolutionConfig Synchronously use the kind of the item to determine if brackets should be added
23+
--- @field semantic_token_resolution blink.cmp.AutoBracketResolutionConfig Asynchronously use semantic token to determine if brackets should be added
24+
25+
--- @class blink.cmp.AutoBracketResolutionConfig
26+
--- @field enabled boolean
27+
--- @field blocked_filetypes string[]
28+
1329
--- @class blink.cmp.TriggerConfig
1430
--- @field context_regex string
1531
--- @field blocked_trigger_characters string[]
@@ -66,6 +82,8 @@
6682
--- @field update_delay_ms number Delay before updating the documentation window
6783

6884
--- @class blink.cmp.Config
85+
--- @field keymap blink.cmp.KeymapConfig
86+
--- @field accept blink.cmp.AcceptConfig
6987
--- @field trigger blink.cmp.TriggerConfig
7088
--- @field fuzzy blink.cmp.FuzzyConfig
7189
--- @field sources blink.cmp.SourceConfig
@@ -94,6 +112,24 @@ local config = {
94112
snippet_backward = '<S-Tab>',
95113
},
96114

115+
accept = {
116+
auto_brackets = {
117+
enabled = false,
118+
default_brackets = { '(', ')' },
119+
override_brackets_for_filetypes = {},
120+
force_allow_filetypes = {},
121+
blocked_filetypes = {},
122+
kind_resolution = {
123+
enabled = true,
124+
blocked_filetypes = { 'typescript', 'typescriptreact', 'javascript', 'javascriptreact', 'vue' },
125+
},
126+
semantic_token_resolution = {
127+
enabled = true,
128+
blocked_filetypes = {},
129+
},
130+
},
131+
},
132+
97133
trigger = {
98134
-- regex used to get the text when fuzzy matching
99135
-- changing this may break some sources, so please report if you run into issues
@@ -155,7 +191,7 @@ local config = {
155191
autocomplete_south = { 'e', 'w', 's', 'n' },
156192
},
157193
auto_show = true,
158-
auto_show_delay_ms = 0,
194+
auto_show_delay_ms = 500,
159195
update_delay_ms = 100,
160196
},
161197
},

0 commit comments

Comments
 (0)