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