@@ -2,11 +2,11 @@ use std::{fmt::Write as _, io::Write as _};
2
2
3
3
use gen_lsp_server:: ErrorCode ;
4
4
use lsp_types:: {
5
- CodeAction , CodeActionResponse , CodeLens , Command , Diagnostic , DiagnosticSeverity ,
6
- DocumentFormattingParams , DocumentHighlight , DocumentSymbol , FoldingRange , FoldingRangeKind ,
7
- FoldingRangeParams , Hover , HoverContents , Location , MarkupContent , MarkupKind , Position ,
8
- PrepareRenameResponse , Range , RenameParams , SymbolInformation , TextDocumentIdentifier ,
9
- TextEdit , WorkspaceEdit ,
5
+ CodeAction , CodeActionResponse , CodeLens , Command , CompletionItem , Diagnostic ,
6
+ DiagnosticSeverity , DocumentFormattingParams , DocumentHighlight , DocumentSymbol , FoldingRange ,
7
+ FoldingRangeKind , FoldingRangeParams , Hover , HoverContents , Location , MarkupContent ,
8
+ MarkupKind , Position , PrepareRenameResponse , Range , RenameParams , SymbolInformation ,
9
+ TextDocumentIdentifier , TextEdit , WorkspaceEdit ,
10
10
} ;
11
11
use ra_ide_api:: {
12
12
AssistId , Cancelable , FileId , FilePosition , FileRange , FoldKind , Query , RangeInfo ,
@@ -212,7 +212,7 @@ pub fn handle_document_symbol(
212
212
}
213
213
}
214
214
215
- Ok ( Some ( req :: DocumentSymbolResponse :: Nested ( res) ) )
215
+ Ok ( Some ( res. into ( ) ) )
216
216
}
217
217
218
218
pub fn handle_workspace_symbol (
@@ -275,7 +275,7 @@ pub fn handle_goto_definition(
275
275
. map ( |nav| RangeInfo :: new ( nav_range, nav) )
276
276
. map ( |nav| to_location_link ( & nav, & world, & line_index) )
277
277
. collect :: < Result < Vec < _ > > > ( ) ?;
278
- Ok ( Some ( req :: GotoDefinitionResponse :: Link ( res) ) )
278
+ Ok ( Some ( res. into ( ) ) )
279
279
}
280
280
281
281
pub fn handle_goto_implementation (
@@ -295,7 +295,7 @@ pub fn handle_goto_implementation(
295
295
. map ( |nav| RangeInfo :: new ( nav_range, nav) )
296
296
. map ( |nav| to_location_link ( & nav, & world, & line_index) )
297
297
. collect :: < Result < Vec < _ > > > ( ) ?;
298
- Ok ( Some ( req :: GotoDefinitionResponse :: Link ( res) ) )
298
+ Ok ( Some ( res. into ( ) ) )
299
299
}
300
300
301
301
pub fn handle_goto_type_definition (
@@ -315,7 +315,7 @@ pub fn handle_goto_type_definition(
315
315
. map ( |nav| RangeInfo :: new ( nav_range, nav) )
316
316
. map ( |nav| to_location_link ( & nav, & world, & line_index) )
317
317
. collect :: < Result < Vec < _ > > > ( ) ?;
318
- Ok ( Some ( req :: GotoDefinitionResponse :: Link ( res) ) )
318
+ Ok ( Some ( res. into ( ) ) )
319
319
}
320
320
321
321
pub fn handle_parent_module (
@@ -433,9 +433,10 @@ pub fn handle_completion(
433
433
Some ( items) => items,
434
434
} ;
435
435
let line_index = world. analysis ( ) . file_line_index ( position. file_id ) ;
436
- let items = items. into_iter ( ) . map ( |item| item. conv_with ( & line_index) ) . collect ( ) ;
436
+ let items: Vec < CompletionItem > =
437
+ items. into_iter ( ) . map ( |item| item. conv_with ( & line_index) ) . collect ( ) ;
437
438
438
- Ok ( Some ( req :: CompletionResponse :: Array ( items) ) )
439
+ Ok ( Some ( items. into ( ) ) )
439
440
}
440
441
441
442
pub fn handle_folding_range (
0 commit comments