@@ -6,9 +6,9 @@ use std::{
6
6
} ;
7
7
8
8
use ide:: {
9
- Annotation , AnnotationKind , Assist , AssistKind , Cancellable , CompletionItem ,
10
- CompletionItemKind , CompletionRelevance , Documentation , FileId , FileRange , FileSystemEdit ,
11
- Fold , FoldKind , Highlight , HlMod , HlOperator , HlPunct , HlRange , HlTag , Indel ,
9
+ Annotation , AnnotationKind , Assist , AssistKind , Cancellable , CompletionFieldsToResolve ,
10
+ CompletionItem , CompletionItemKind , CompletionRelevance , Documentation , FileId , FileRange ,
11
+ FileSystemEdit , Fold , FoldKind , Highlight , HlMod , HlOperator , HlPunct , HlRange , HlTag , Indel ,
12
12
InlayFieldsToResolve , InlayHint , InlayHintLabel , InlayHintLabelPart , InlayKind , Markup ,
13
13
NavigationTarget , ReferenceCategory , RenameError , Runnable , Severity , SignatureHelp ,
14
14
SnippetEdit , SourceChange , StructureNodeKind , SymbolKind , TextEdit , TextRange , TextSize ,
@@ -227,9 +227,11 @@ pub(crate) fn snippet_text_edit_vec(
227
227
228
228
pub ( crate ) fn completion_items (
229
229
config : & Config ,
230
+ fields_to_resolve : & CompletionFieldsToResolve ,
230
231
line_index : & LineIndex ,
231
232
version : Option < i32 > ,
232
233
tdpp : lsp_types:: TextDocumentPositionParams ,
234
+ completion_trigger_character : Option < char > ,
233
235
mut items : Vec < CompletionItem > ,
234
236
) -> Vec < lsp_types:: CompletionItem > {
235
237
if config. completion_hide_deprecated ( ) {
@@ -239,7 +241,17 @@ pub(crate) fn completion_items(
239
241
let max_relevance = items. iter ( ) . map ( |it| it. relevance . score ( ) ) . max ( ) . unwrap_or_default ( ) ;
240
242
let mut res = Vec :: with_capacity ( items. len ( ) ) ;
241
243
for item in items {
242
- completion_item ( & mut res, config, line_index, version, & tdpp, max_relevance, item) ;
244
+ completion_item (
245
+ & mut res,
246
+ config,
247
+ fields_to_resolve,
248
+ line_index,
249
+ version,
250
+ & tdpp,
251
+ max_relevance,
252
+ completion_trigger_character,
253
+ item,
254
+ ) ;
243
255
}
244
256
245
257
if let Some ( limit) = config. completion ( None ) . limit {
@@ -253,17 +265,20 @@ pub(crate) fn completion_items(
253
265
fn completion_item (
254
266
acc : & mut Vec < lsp_types:: CompletionItem > ,
255
267
config : & Config ,
268
+ fields_to_resolve : & CompletionFieldsToResolve ,
256
269
line_index : & LineIndex ,
257
270
version : Option < i32 > ,
258
271
tdpp : & lsp_types:: TextDocumentPositionParams ,
259
272
max_relevance : u32 ,
273
+ completion_trigger_character : Option < char > ,
260
274
item : CompletionItem ,
261
275
) {
262
276
let insert_replace_support = config. insert_replace_support ( ) . then_some ( tdpp. position ) ;
263
277
let ref_match = item. ref_match ( ) ;
264
278
let lookup = item. lookup ( ) . to_owned ( ) ;
265
279
266
280
let mut additional_text_edits = Vec :: new ( ) ;
281
+ let mut something_to_resolve = false ;
267
282
268
283
// LSP does not allow arbitrary edits in completion, so we have to do a
269
284
// non-trivial mapping here.
@@ -337,7 +352,12 @@ fn completion_item(
337
352
} )
338
353
. collect :: < Vec < _ > > ( ) ;
339
354
if !imports. is_empty ( ) {
340
- let data = lsp_ext:: CompletionResolveData { position : tdpp. clone ( ) , imports, version } ;
355
+ let data = lsp_ext:: CompletionResolveData {
356
+ position : tdpp. clone ( ) ,
357
+ imports,
358
+ version,
359
+ completion_trigger_character,
360
+ } ;
341
361
lsp_item. data = Some ( to_value ( data) . unwrap ( ) ) ;
342
362
}
343
363
}
0 commit comments