File tree 4 files changed +25
-2
lines changed
4 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -134,4 +134,13 @@ function sources.cancel_signature_help()
134
134
end
135
135
end
136
136
137
+ --- Misc ---
138
+
139
+ --- For external integrations to force reloading the source
140
+ function sources .reload ()
141
+ for _ , source in ipairs (sources .providers ) do
142
+ source :reload ()
143
+ end
144
+ end
145
+
137
146
return sources
Original file line number Diff line number Diff line change @@ -114,4 +114,12 @@ function source:get_signature_help(context)
114
114
end )
115
115
end
116
116
117
+ --- Misc ---
118
+
119
+ --- For external integrations to force reloading the source
120
+ function source :reload ()
121
+ if self .module .reload == nil then return end
122
+ self .module :reload ()
123
+ end
124
+
117
125
return source
Original file line number Diff line number Diff line change 15
15
--- @field filter_completions (fun ( self : blink.cmp.Source , response : blink.cmp.CompletionResponse ): blink.cmp.CompletionItem[] ) | nil
16
16
--- @field should_show_completions (fun ( self : blink.cmp.Source , context : blink.cmp.Context , response : blink.cmp.CompletionResponse ): boolean ) | nil
17
17
--- @field resolve (fun ( self : blink.cmp.Source , item : blink.cmp.CompletionItem , callback : fun ( resolved_item : lsp.CompletionItem | nil )): (( fun (): nil ) | nil )) | nil
18
+ --- @field get_signature_help_trigger_characters fun ( self : blink.cmp.Source ): string[]
19
+ --- @field get_signature_help fun ( self : blink.cmp.Source , context : blink.cmp.SignatureHelpContext ): blink.cmp.Task
20
+ --- @field reload (fun ( self : blink.cmp.Source ): nil ) | nil
18
21
---
19
22
--- @class blink.cmp.SourceProvider
20
23
--- @field name string
27
30
--- @field resolve fun ( self : blink.cmp.SourceProvider , item : blink.cmp.CompletionItem ): blink.cmp.Task
28
31
--- @field get_signature_help_trigger_characters fun ( self : blink.cmp.SourceProvider ): string[]
29
32
--- @field get_signature_help fun ( self : blink.cmp.SourceProvider , context : blink.cmp.SignatureHelpContext ): blink.cmp.Task
33
+ --- @field reload (fun ( self : blink.cmp.Source ): nil ) | nil
Original file line number Diff line number Diff line change @@ -12,8 +12,7 @@ function snippets.new(config)
12
12
--- @type table<string , blink.cmp.CompletionItem[]>
13
13
self .cache = {}
14
14
--- @type blink.cmp.SnippetsOpts
15
- local opts = config .opts or {}
16
- self .registry = require (' blink.cmp.sources.snippets.registry' ).new (opts )
15
+ self .registry = require (' blink.cmp.sources.snippets.registry' ).new (config .opts or {})
17
16
return self
18
17
end
19
18
@@ -59,4 +58,7 @@ function snippets:resolve(item, callback)
59
58
callback (resolved_item )
60
59
end
61
60
61
+ --- For external integrations to force reloading the snippets
62
+ function snippets :reload () self .cache = {} end
63
+
62
64
return snippets
You can’t perform that action at this time.
0 commit comments