1
+ --- @alias SuggestionNotification fun ( virtual_text : {}, virtual_lines : {})
2
+
1
3
--- @class (exact ) SuggestionConfig
2
4
--- @field enabled boolean Whether to enable the suggestion
3
5
--- @field auto_trigger boolean Whether to trigger the suggestion automatically
4
6
--- @field hide_during_completion boolean Whether to hide the suggestion during completion
5
7
--- @field debounce integer Debounce time in milliseconds
6
8
--- @field trigger_on_accept boolean To either trigger the suggestion on accept or pass the keystroke to the buffer
9
+ --- @field suggestion_notification SuggestionNotification | nil Callback function whenever a suggestion is triggered
7
10
--- @field keymap SuggestionKeymapConfig Keymap for the suggestion
8
11
9
12
--- @class (exact ) SuggestionKeymapConfig
@@ -22,6 +25,7 @@ local suggestion = {
22
25
hide_during_completion = true ,
23
26
debounce = 15 ,
24
27
trigger_on_accept = true ,
28
+ suggestion_notification = nil ,
25
29
keymap = {
26
30
accept = " <M-l>" ,
27
31
accept_word = false ,
@@ -39,6 +43,7 @@ function suggestion.validate(config)
39
43
vim .validate (" hide_during_completion" , config .hide_during_completion , " boolean" )
40
44
vim .validate (" debounce" , config .debounce , { " number" , " nil" })
41
45
vim .validate (" trigger_on_accept" , config .trigger_on_accept , " boolean" )
46
+ vim .validate (" suggestion_notification" , config .suggestion_notification , { " function" , " nil" })
42
47
vim .validate (" keymap" , config .keymap , " table" )
43
48
vim .validate (" keymap.accept" , config .keymap .accept , { " string" , " boolean" })
44
49
vim .validate (" keymap.accept_word" , config .keymap .accept_word , { " string" , " boolean" })
0 commit comments