@@ -326,10 +326,10 @@ pub fn handle_workspace_symbol(
326326
327327pub fn handle_goto_definition (
328328 world : WorldSnapshot ,
329- params : req:: TextDocumentPositionParams ,
329+ params : req:: GotoDefinitionParams ,
330330) -> Result < Option < req:: GotoDefinitionResponse > > {
331331 let _p = profile ( "handle_goto_definition" ) ;
332- let position = params. try_conv_with ( & world) ?;
332+ let position = params. text_document_position_params . try_conv_with ( & world) ?;
333333 let nav_info = match world. analysis ( ) . goto_definition ( position) ? {
334334 None => return Ok ( None ) ,
335335 Some ( it) => it,
@@ -340,10 +340,10 @@ pub fn handle_goto_definition(
340340
341341pub fn handle_goto_implementation (
342342 world : WorldSnapshot ,
343- params : req:: TextDocumentPositionParams ,
343+ params : req:: GotoImplementationParams ,
344344) -> Result < Option < req:: GotoImplementationResponse > > {
345345 let _p = profile ( "handle_goto_implementation" ) ;
346- let position = params. try_conv_with ( & world) ?;
346+ let position = params. text_document_position_params . try_conv_with ( & world) ?;
347347 let nav_info = match world. analysis ( ) . goto_implementation ( position) ? {
348348 None => return Ok ( None ) ,
349349 Some ( it) => it,
@@ -354,10 +354,10 @@ pub fn handle_goto_implementation(
354354
355355pub fn handle_goto_type_definition (
356356 world : WorldSnapshot ,
357- params : req:: TextDocumentPositionParams ,
357+ params : req:: GotoTypeDefinitionParams ,
358358) -> Result < Option < req:: GotoTypeDefinitionResponse > > {
359359 let _p = profile ( "handle_goto_type_definition" ) ;
360- let position = params. try_conv_with ( & world) ?;
360+ let position = params. text_document_position_params . try_conv_with ( & world) ?;
361361 let nav_info = match world. analysis ( ) . goto_type_definition ( position) ? {
362362 None => return Ok ( None ) ,
363363 Some ( it) => it,
@@ -487,10 +487,10 @@ pub fn handle_folding_range(
487487
488488pub fn handle_signature_help (
489489 world : WorldSnapshot ,
490- params : req:: TextDocumentPositionParams ,
490+ params : req:: SignatureHelpParams ,
491491) -> Result < Option < req:: SignatureHelp > > {
492492 let _p = profile ( "handle_signature_help" ) ;
493- let position = params. try_conv_with ( & world) ?;
493+ let position = params. text_document_position_params . try_conv_with ( & world) ?;
494494 if let Some ( call_info) = world. analysis ( ) . call_info ( position) ? {
495495 let concise = !world. config . call_info_full ;
496496 let mut active_parameter = call_info. active_parameter . map ( |it| it as i64 ) ;
@@ -509,12 +509,9 @@ pub fn handle_signature_help(
509509 }
510510}
511511
512- pub fn handle_hover (
513- world : WorldSnapshot ,
514- params : req:: TextDocumentPositionParams ,
515- ) -> Result < Option < Hover > > {
512+ pub fn handle_hover ( world : WorldSnapshot , params : req:: HoverParams ) -> Result < Option < Hover > > {
516513 let _p = profile ( "handle_hover" ) ;
517- let position = params. try_conv_with ( & world) ?;
514+ let position = params. text_document_position_params . try_conv_with ( & world) ?;
518515 let info = match world. analysis ( ) . hover ( position) ? {
519516 None => return Ok ( None ) ,
520517 Some ( info) => info,
@@ -878,8 +875,14 @@ pub fn handle_code_lens(
878875 . map ( |it| {
879876 let range = it. node_range . conv_with ( & line_index) ;
880877 let pos = range. start ;
881- let lens_params =
882- req:: TextDocumentPositionParams :: new ( params. text_document . clone ( ) , pos) ;
878+ let lens_params = req:: GotoImplementationParams {
879+ text_document_position_params : req:: TextDocumentPositionParams :: new (
880+ params. text_document . clone ( ) ,
881+ pos,
882+ ) ,
883+ work_done_progress_params : Default :: default ( ) ,
884+ partial_result_params : Default :: default ( ) ,
885+ } ;
883886 CodeLens {
884887 range,
885888 command : None ,
@@ -894,7 +897,7 @@ pub fn handle_code_lens(
894897#[ derive( Debug , Serialize , Deserialize ) ]
895898#[ serde( rename_all = "camelCase" ) ]
896899enum CodeLensResolveData {
897- Impls ( req:: TextDocumentPositionParams ) ,
900+ Impls ( req:: GotoImplementationParams ) ,
898901}
899902
900903pub fn handle_code_lens_resolve ( world : WorldSnapshot , code_lens : CodeLens ) -> Result < CodeLens > {
@@ -927,7 +930,7 @@ pub fn handle_code_lens_resolve(world: WorldSnapshot, code_lens: CodeLens) -> Re
927930 title,
928931 command : "rust-analyzer.showReferences" . into ( ) ,
929932 arguments : Some ( vec ! [
930- to_value( & lens_params. text_document. uri) . unwrap( ) ,
933+ to_value( & lens_params. text_document_position_params . text_document. uri) . unwrap( ) ,
931934 to_value( code_lens. range. start) . unwrap( ) ,
932935 to_value( locations) . unwrap( ) ,
933936 ] ) ,
@@ -944,16 +947,16 @@ pub fn handle_code_lens_resolve(world: WorldSnapshot, code_lens: CodeLens) -> Re
944947
945948pub fn handle_document_highlight (
946949 world : WorldSnapshot ,
947- params : req:: TextDocumentPositionParams ,
950+ params : req:: DocumentHighlightParams ,
948951) -> Result < Option < Vec < DocumentHighlight > > > {
949952 let _p = profile ( "handle_document_highlight" ) ;
950- let file_id = params. text_document . try_conv_with ( & world) ?;
953+ let file_id = params. text_document_position_params . text_document . try_conv_with ( & world) ?;
951954 let line_index = world. analysis ( ) . file_line_index ( file_id) ?;
952955
953- let refs = match world
954- . analysis ( )
955- . find_all_refs ( params . try_conv_with ( & world ) ? , Some ( SearchScope :: single_file ( file_id) ) ) ?
956- {
956+ let refs = match world. analysis ( ) . find_all_refs (
957+ params . text_document_position_params . try_conv_with ( & world ) ? ,
958+ Some ( SearchScope :: single_file ( file_id) ) ,
959+ ) ? {
957960 None => return Ok ( None ) ,
958961 Some ( refs) => refs,
959962 } ;
0 commit comments