@@ -9,8 +9,7 @@ use lsp_types::{
99 TextDocumentIdentifier , TextEdit , WorkspaceEdit ,
1010} ;
1111use ra_ide_api:: {
12- AssistId , Cancelable , FileId , FilePosition , FileRange , FoldKind , Query , RangeInfo ,
13- RunnableKind , Severity ,
12+ AssistId , Cancelable , FileId , FilePosition , FileRange , FoldKind , Query , RunnableKind , Severity ,
1413} ;
1514use ra_prof:: profile;
1615use ra_syntax:: { AstNode , SyntaxKind , TextRange , TextUnit } ;
@@ -267,13 +266,8 @@ pub fn handle_goto_definition(
267266 None => return Ok ( None ) ,
268267 Some ( it) => it,
269268 } ;
270- let nav_range = nav_info. range ;
271- let res = nav_info
272- . info
273- . into_iter ( )
274- . map ( |nav| ( position. file_id , RangeInfo :: new ( nav_range, nav) ) )
275- . try_conv_with_to_vec ( & world) ?;
276- Ok ( Some ( res. into ( ) ) )
269+ let res = ( position. file_id , nav_info) . try_conv_with ( & world) ?;
270+ Ok ( Some ( res) )
277271}
278272
279273pub fn handle_goto_implementation (
@@ -285,13 +279,8 @@ pub fn handle_goto_implementation(
285279 None => return Ok ( None ) ,
286280 Some ( it) => it,
287281 } ;
288- let nav_range = nav_info. range ;
289- let res = nav_info
290- . info
291- . into_iter ( )
292- . map ( |nav| ( position. file_id , RangeInfo :: new ( nav_range, nav) ) )
293- . try_conv_with_to_vec ( & world) ?;
294- Ok ( Some ( res. into ( ) ) )
282+ let res = ( position. file_id , nav_info) . try_conv_with ( & world) ?;
283+ Ok ( Some ( res) )
295284}
296285
297286pub fn handle_goto_type_definition (
@@ -303,13 +292,8 @@ pub fn handle_goto_type_definition(
303292 None => return Ok ( None ) ,
304293 Some ( it) => it,
305294 } ;
306- let nav_range = nav_info. range ;
307- let res = nav_info
308- . info
309- . into_iter ( )
310- . map ( |nav| ( position. file_id , RangeInfo :: new ( nav_range, nav) ) )
311- . try_conv_with_to_vec ( & world) ?;
312- Ok ( Some ( res. into ( ) ) )
295+ let res = ( position. file_id , nav_info) . try_conv_with ( & world) ?;
296+ Ok ( Some ( res) )
313297}
314298
315299pub fn handle_parent_module (
0 commit comments