Skip to content

Commit 9c73b0d

Browse files
fix(config): make blink lua config fields optional (#18)
1 parent 23e3fd9 commit 9c73b0d

File tree

1 file changed

+91
-91
lines changed

1 file changed

+91
-91
lines changed

lua/blink/cmp/config.lua

+91-91
Original file line numberDiff line numberDiff line change
@@ -1,137 +1,137 @@
11
--- @class blink.cmp.KeymapConfig
2-
--- @field show string | string[]
3-
--- @field accept string | string[]
4-
--- @field select_prev string | string[]
5-
--- @field select_next string | string[]
6-
--- @field show_documentation string | string[]
7-
--- @field hide_documentation string | string[]
8-
--- @field scroll_documentation_up string | string[]
9-
--- @field scroll_documentation_down string | string[]
10-
--- @field snippet_forward string | string[]
11-
--- @field snippet_backward string | string[]
2+
--- @field show? string | string[]
3+
--- @field accept? string | string[]
4+
--- @field select_prev? string | string[]
5+
--- @field select_next? string | string[]
6+
--- @field show_documentation? string | string[]
7+
--- @field hide_documentation? string | string[]
8+
--- @field scroll_documentation_up? string | string[]
9+
--- @field scroll_documentation_down? string | string[]
10+
--- @field snippet_forward? string | string[]
11+
--- @field snippet_backward? string | string[]
1212

1313
--- @class blink.cmp.AcceptConfig
14-
--- @field create_undo_point boolean Create an undo point when accepting a completion item
15-
--- @field auto_brackets blink.cmp.AutoBracketsConfig
14+
--- @field create_undo_point? boolean Create an undo point when accepting a completion item
15+
--- @field auto_brackets? blink.cmp.AutoBracketsConfig
1616

1717
--- @class blink.cmp.AutoBracketsConfig
18-
--- @field enabled boolean
19-
--- @field default_brackets string[]
20-
--- @field override_brackets_for_filetypes table<string, string[] | function(item: blink.cmp.CompletionItem): string[]>
21-
--- @field force_allow_filetypes string[] Overrides the default blocked filetypes
22-
--- @field blocked_filetypes string[]
23-
--- @field kind_resolution blink.cmp.AutoBracketResolutionConfig Synchronously use the kind of the item to determine if brackets should be added
24-
--- @field semantic_token_resolution blink.cmp.AutoBracketSemanticTokenResolutionConfig Asynchronously use semantic token to determine if brackets should be added
18+
--- @field enabled? boolean
19+
--- @field default_brackets? string[]
20+
--- @field override_brackets_for_filetypes? table<string, string[] | function(item: blink.cmp.CompletionItem): string[]>
21+
--- @field force_allow_filetypes? string[] Overrides the default blocked filetypes
22+
--- @field blocked_filetypes? string[]
23+
--- @field kind_resolution? blink.cmp.AutoBracketResolutionConfig Synchronously use the kind of the item to determine if brackets should be added
24+
--- @field semantic_token_resolution? blink.cmp.AutoBracketSemanticTokenResolutionConfig Asynchronously use semantic token to determine if brackets should be added
2525

2626
--- @class blink.cmp.AutoBracketResolutionConfig
27-
--- @field enabled boolean
28-
--- @field blocked_filetypes string[]
27+
--- @field enabled? boolean
28+
--- @field blocked_filetypes? string[]
2929
---
3030
--- @class blink.cmp.AutoBracketSemanticTokenResolutionConfig : blink.cmp.AutoBracketResolutionConfig
31-
--- @field timeout_ms number How long to wait for semantic tokens to return before assuming no brackets should be added
31+
--- @field timeout_ms? number How long to wait for semantic tokens to return before assuming no brackets should be added
3232

3333
--- @class blink.cmp.CompletionTriggerConfig
34-
--- @field keyword_regex string
35-
--- @field blocked_trigger_characters string[]
36-
--- @field show_on_insert_on_trigger_character boolean When true, will show the completion window when the cursor comes after a trigger character when entering insert mode
37-
--- @field show_on_insert_blocked_trigger_characters string[] List of additional trigger characters that won't trigger the completion window when the cursor comes after a trigger character when entering insert mode
34+
--- @field keyword_regex? string
35+
--- @field blocked_trigger_characters? string[]
36+
--- @field show_on_insert_on_trigger_character? boolean When true, will show the completion window when the cursor comes after a trigger character when entering insert mode
37+
--- @field show_on_insert_blocked_trigger_characters? string[] List of additional trigger characters that won't trigger the completion window when the cursor comes after a trigger character when entering insert mode
3838
---
3939
--- @class blink.cmp.SignatureHelpTriggerConfig
40-
--- @field enabled boolean
41-
--- @field blocked_trigger_characters string[]
42-
--- @field blocked_retrigger_characters string[]
43-
--- @field show_on_insert_on_trigger_character boolean When true, will show the signature help window when the cursor comes after a trigger character when entering insert mode
40+
--- @field enabled? boolean
41+
--- @field blocked_trigger_characters? string[]
42+
--- @field blocked_retrigger_characters? string[]
43+
--- @field show_on_insert_on_trigger_character? boolean When true, will show the signature help window when the cursor comes after a trigger character when entering insert mode
4444
---
4545
--- @class blink.cmp.TriggerConfig
46-
--- @field completion blink.cmp.CompletionTriggerConfig
47-
--- @field signature_help blink.cmp.SignatureHelpTriggerConfig
46+
--- @field completion? blink.cmp.CompletionTriggerConfig
47+
--- @field signature_help? blink.cmp.SignatureHelpTriggerConfig
4848

4949
--- @class blink.cmp.SourceConfig
50-
--- @field providers blink.cmp.SourceProviderConfig[][]
50+
--- @field providers? blink.cmp.SourceProviderConfig[][]
5151
---
5252
--- @class blink.cmp.SourceProviderConfig
53-
--- @field [1] string
54-
--- @field keyword_length number | nil
55-
--- @field score_offset number | nil
56-
--- @field deduplicate blink.cmp.DeduplicateConfig | nil
57-
--- @field trigger_characters string[] | nil
58-
--- @field opts table | nil
53+
--- @field [1]? string
54+
--- @field keyword_length? number | nil
55+
--- @field score_offset? number | nil
56+
--- @field deduplicate? blink.cmp.DeduplicateConfig | nil
57+
--- @field trigger_characters? string[] | nil
58+
--- @field opts? table | nil
5959
---
6060
--- @class blink.cmp.DeduplicateConfig
61-
--- @field enabled boolean
62-
--- @field priority number
61+
--- @field enabled? boolean
62+
--- @field priority? number
6363

6464
--- @class blink.cmp.PrebuiltBinariesConfig
65-
--- @field download boolean
66-
--- @field forceVersion string | nil
65+
--- @field download? boolean
66+
--- @field forceVersion? string | nil
6767

6868
--- @class blink.cmp.FuzzyConfig
69-
--- @field use_frecency boolean
70-
--- @field use_proximity boolean
71-
--- @field max_items number
72-
--- @field sorts ("label" | "kind" | "score")[]
73-
--- @field prebuiltBinaries blink.cmp.PrebuiltBinariesConfig
69+
--- @field use_frecency? boolean
70+
--- @field use_proximity? boolean
71+
--- @field max_items? number
72+
--- @field sorts? ("label" | "kind" | "score")[]
73+
--- @field prebuiltBinaries? blink.cmp.PrebuiltBinariesConfig
7474

7575
--- @class blink.cmp.WindowConfig
76-
--- @field autocomplete blink.cmp.AutocompleteConfig
77-
--- @field documentation blink.cmp.DocumentationConfig
78-
--- @field signature_help blink.cmp.SignatureHelpConfig
76+
--- @field autocomplete? blink.cmp.AutocompleteConfig
77+
--- @field documentation? blink.cmp.DocumentationConfig
78+
--- @field signature_help? blink.cmp.SignatureHelpConfig
7979

8080
--- @class blink.cmp.HighlightConfig
81-
--- @field ns number
82-
--- @field use_nvim_cmp_as_default boolean
81+
--- @field ns? number
82+
--- @field use_nvim_cmp_as_default? boolean
8383

8484
--- @class blink.cmp.AutocompleteConfig
85-
--- @field min_width number
86-
--- @field max_width number
87-
--- @field max_height number
88-
--- @field border blink.cmp.WindowBorder
89-
--- @field order "top_down" | "bottom_up"
90-
--- @field direction_priority ("n" | "s")[]
91-
--- @field preselect boolean
92-
--- @field winhighlight string
93-
--- @field scrolloff number
94-
--- @field draw 'simple' | 'reversed' | function(blink.cmp.CompletionRenderContext): blink.cmp.Component[]
95-
--- @field cycle blink.cmp.AutocompleteConfig.CycleConfig
85+
--- @field min_width? number
86+
--- @field max_width? number
87+
--- @field max_height? number
88+
--- @field border? blink.cmp.WindowBorder
89+
--- @field order? "top_down" | "bottom_up"
90+
--- @field direction_priority? ("n" | "s")[]
91+
--- @field preselect? boolean
92+
--- @field winhighlight? string
93+
--- @field scrolloff? number
94+
--- @field draw? 'simple' | 'reversed' | function(blink.cmp.CompletionRenderContext): blink.cmp.Component[]
95+
--- @field cycle? blink.cmp.AutocompleteConfig.CycleConfig
9696

9797
--- @class blink.cmp.AutocompleteConfig.CycleConfig
98-
--- @field from_bottom boolean When `true`, calling `select_next` at the *bottom* of the completion list will select the *first* completion item.
99-
--- @field from_top boolean When `true`, calling `select_prev` at the *top* of the completion list will select the *last* completion item.
98+
--- @field from_bottom? boolean When `true`, calling `select_next` at the *bottom* of the completion list will select the *first* completion item.
99+
--- @field from_top? boolean When `true`, calling `select_prev` at the *top* of the completion list will select the *last* completion item.
100100

101101
--- @class blink.cmp.DocumentationDirectionPriorityConfig
102-
--- @field autocomplete_north ("n" | "s" | "e" | "w")[]
103-
--- @field autocomplete_south ("n" | "s" | "e" | "w")[]
102+
--- @field autocomplete_north? ("n" | "s" | "e" | "w")[]
103+
--- @field autocomplete_south? ("n" | "s" | "e" | "w")[]
104104
---
105105
--- @alias blink.cmp.WindowBorder 'single' | 'double' | 'rounded' | 'solid' | 'shadow' | 'padded' | 'none' | string[]
106106
---
107107
--- @class blink.cmp.DocumentationConfig
108-
--- @field min_width number
109-
--- @field max_width number
110-
--- @field max_height number
111-
--- @field border blink.cmp.WindowBorder
112-
--- @field direction_priority blink.cmp.DocumentationDirectionPriorityConfig
113-
--- @field auto_show boolean
114-
--- @field auto_show_delay_ms number Delay before showing the documentation window
115-
--- @field update_delay_ms number Delay before updating the documentation window
116-
--- @field winhighlight string
108+
--- @field min_width? number
109+
--- @field max_width? number
110+
--- @field max_height? number
111+
--- @field border? blink.cmp.WindowBorder
112+
--- @field direction_priority? blink.cmp.DocumentationDirectionPriorityConfig
113+
--- @field auto_show? boolean
114+
--- @field auto_show_delay_ms? number Delay before showing the documentation window
115+
--- @field update_delay_ms? number Delay before updating the documentation window
116+
--- @field winhighlight? string
117117

118118
--- @class blink.cmp.SignatureHelpConfig
119-
--- @field min_width number
120-
--- @field max_width number
121-
--- @field max_height number
122-
--- @field border blink.cmp.WindowBorder
123-
--- @field winhighlight string
119+
--- @field min_width? number
120+
--- @field max_width? number
121+
--- @field max_height? number
122+
--- @field border? blink.cmp.WindowBorder
123+
--- @field winhighlight? string
124124

125125
--- @class blink.cmp.Config
126-
--- @field keymap blink.cmp.KeymapConfig
127-
--- @field accept blink.cmp.AcceptConfig
128-
--- @field trigger blink.cmp.TriggerConfig
129-
--- @field fuzzy blink.cmp.FuzzyConfig
130-
--- @field sources blink.cmp.SourceConfig
131-
--- @field windows blink.cmp.WindowConfig
132-
--- @field highlight blink.cmp.HighlightConfig
133-
--- @field nerd_font_variant 'mono' | 'normal'
134-
--- @field kind_icons table<string, string>
126+
--- @field keymap? blink.cmp.KeymapConfig
127+
--- @field accept? blink.cmp.AcceptConfig
128+
--- @field trigger? blink.cmp.TriggerConfig
129+
--- @field fuzzy? blink.cmp.FuzzyConfig
130+
--- @field sources? blink.cmp.SourceConfig
131+
--- @field windows? blink.cmp.WindowConfig
132+
--- @field highlight? blink.cmp.HighlightConfig
133+
--- @field nerd_font_variant? 'mono' | 'normal'
134+
--- @field kind_icons? table<string, string>
135135

136136
--- @type blink.cmp.Config
137137
local config = {

0 commit comments

Comments
 (0)