@@ -439,9 +439,11 @@ fn client_test_complete_self_crate_name() {
439439 trigger_character : Some ( ":" . to_string ( ) ) ,
440440 trigger_kind : CompletionTriggerKind :: TriggerCharacter ,
441441 } ) ,
442- position : Position :: new ( 2 , 32 ) ,
443- text_document : TextDocumentIdentifier {
444- uri : Url :: from_file_path ( p. root ( ) . join ( "library/tests/test.rs" ) ) . unwrap ( ) ,
442+ text_document_position : TextDocumentPositionParams {
443+ position : Position :: new ( 2 , 32 ) ,
444+ text_document : TextDocumentIdentifier {
445+ uri : Url :: from_file_path ( p. root ( ) . join ( "library/tests/test.rs" ) ) . unwrap ( ) ,
446+ } ,
445447 } ,
446448 } ,
447449 ) ;
@@ -537,9 +539,11 @@ fn client_completion_suggests_arguments_in_statements() {
537539 trigger_character : Some ( "f" . to_string ( ) ) ,
538540 trigger_kind : CompletionTriggerKind :: TriggerCharacter ,
539541 } ) ,
540- position : Position :: new ( 3 , 41 ) ,
541- text_document : TextDocumentIdentifier {
542- uri : Url :: from_file_path ( p. root ( ) . join ( "library/tests/test.rs" ) ) . unwrap ( ) ,
542+ text_document_position : TextDocumentPositionParams {
543+ position : Position :: new ( 3 , 41 ) ,
544+ text_document : TextDocumentIdentifier {
545+ uri : Url :: from_file_path ( p. root ( ) . join ( "library/tests/test.rs" ) ) . unwrap ( ) ,
546+ } ,
543547 } ,
544548 } ,
545549 ) ;
@@ -603,9 +607,11 @@ fn client_use_statement_completion_doesnt_suggest_arguments() {
603607 trigger_character : Some ( ":" . to_string ( ) ) ,
604608 trigger_kind : CompletionTriggerKind :: TriggerCharacter ,
605609 } ) ,
606- position : Position :: new ( 2 , 32 ) ,
607- text_document : TextDocumentIdentifier {
608- uri : Url :: from_file_path ( p. root ( ) . join ( "library/tests/test.rs" ) ) . unwrap ( ) ,
610+ text_document_position : TextDocumentPositionParams {
611+ position : Position :: new ( 2 , 32 ) ,
612+ text_document : TextDocumentIdentifier {
613+ uri : Url :: from_file_path ( p. root ( ) . join ( "library/tests/test.rs" ) ) . unwrap ( ) ,
614+ } ,
609615 } ,
610616 } ,
611617 ) ;
@@ -1153,13 +1159,10 @@ fn client_deglob() {
11531159 // Right now we only support deglobbing via commands. Please update this
11541160 // test if we move to making text edits via CodeAction (which we should for
11551161 // deglobbing);
1156- let Command { title, command, arguments, .. } = match commands {
1157- CodeActionResponse :: Commands ( commands) => commands,
1158- CodeActionResponse :: Actions ( _) => unimplemented ! ( ) ,
1159- }
1160- . into_iter ( )
1161- . nth ( 0 )
1162- . unwrap ( ) ;
1162+ let Command { title, command, arguments, .. } = match commands. into_iter ( ) . nth ( 0 ) . unwrap ( ) {
1163+ CodeActionOrCommand :: Command ( commands) => commands,
1164+ CodeActionOrCommand :: CodeAction ( _) => unimplemented ! ( ) ,
1165+ } ;
11631166
11641167 let arguments = arguments. expect ( "Missing command arguments" ) ;
11651168
@@ -1214,13 +1217,10 @@ fn client_deglob() {
12141217 // Right now we only support deglobbing via commands. Please update this
12151218 // test if we move to making text edits via CodeAction (which we should for
12161219 // deglobbing);
1217- let Command { title, command, arguments, .. } = match commands {
1218- CodeActionResponse :: Commands ( commands) => commands,
1219- CodeActionResponse :: Actions ( _) => unimplemented ! ( ) ,
1220- }
1221- . into_iter ( )
1222- . nth ( 0 )
1223- . unwrap ( ) ;
1220+ let Command { title, command, arguments, .. } = match commands. into_iter ( ) . nth ( 0 ) . unwrap ( ) {
1221+ CodeActionOrCommand :: Command ( commands) => commands,
1222+ CodeActionOrCommand :: CodeAction ( _) => unimplemented ! ( ) ,
1223+ } ;
12241224
12251225 let arguments = arguments. expect ( "Missing command arguments" ) ;
12261226
@@ -1605,10 +1605,12 @@ fn client_find_all_refs_test() {
16051605 . request :: < References > (
16061606 42 ,
16071607 ReferenceParams {
1608- text_document : TextDocumentIdentifier {
1609- uri : Url :: from_file_path ( p. root ( ) . join ( "src/main.rs" ) ) . unwrap ( ) ,
1608+ text_document_position : TextDocumentPositionParams {
1609+ text_document : TextDocumentIdentifier {
1610+ uri : Url :: from_file_path ( p. root ( ) . join ( "src/main.rs" ) ) . unwrap ( ) ,
1611+ } ,
1612+ position : Position { line : 0 , character : 7 } ,
16101613 } ,
1611- position : Position { line : 0 , character : 7 } ,
16121614 context : ReferenceContext { include_declaration : true } ,
16131615 } ,
16141616 )
@@ -1643,10 +1645,12 @@ fn client_find_all_refs_no_cfg_test() {
16431645 . request :: < References > (
16441646 42 ,
16451647 ReferenceParams {
1646- text_document : TextDocumentIdentifier {
1647- uri : Url :: from_file_path ( p. root ( ) . join ( "src/main.rs" ) ) . unwrap ( ) ,
1648+ text_document_position : TextDocumentPositionParams {
1649+ text_document : TextDocumentIdentifier {
1650+ uri : Url :: from_file_path ( p. root ( ) . join ( "src/main.rs" ) ) . unwrap ( ) ,
1651+ } ,
1652+ position : Position { line : 0 , character : 7 } ,
16481653 } ,
1649- position : Position { line : 0 , character : 7 } ,
16501654 context : ReferenceContext { include_declaration : true } ,
16511655 } ,
16521656 )
@@ -1730,9 +1734,11 @@ fn client_rename() {
17301734 . request :: < Rename > (
17311735 42 ,
17321736 RenameParams {
1733- position : Position { line : 12 , character : 27 } ,
1734- text_document : TextDocumentIdentifier {
1735- uri : Url :: from_file_path ( p. root ( ) . join ( "src/main.rs" ) ) . unwrap ( ) ,
1737+ text_document_position : TextDocumentPositionParams {
1738+ position : Position { line : 12 , character : 27 } ,
1739+ text_document : TextDocumentIdentifier {
1740+ uri : Url :: from_file_path ( p. root ( ) . join ( "src/main.rs" ) ) . unwrap ( ) ,
1741+ } ,
17361742 } ,
17371743 new_name : "foo" . to_owned ( ) ,
17381744 } ,
@@ -1895,8 +1901,10 @@ fn client_completion() {
18951901 let result = rls. request :: < Completion > (
18961902 11 ,
18971903 CompletionParams {
1898- text_document : text_document. clone ( ) ,
1899- position : Position { line : 12 , character : 30 } ,
1904+ text_document_position : TextDocumentPositionParams {
1905+ text_document : text_document. clone ( ) ,
1906+ position : Position { line : 12 , character : 30 } ,
1907+ } ,
19001908 context : None ,
19011909 } ,
19021910 ) ;
@@ -1905,8 +1913,10 @@ fn client_completion() {
19051913 let result = rls. request :: < Completion > (
19061914 11 ,
19071915 CompletionParams {
1908- text_document : text_document. clone ( ) ,
1909- position : Position { line : 15 , character : 30 } ,
1916+ text_document_position : TextDocumentPositionParams {
1917+ text_document : text_document. clone ( ) ,
1918+ position : Position { line : 15 , character : 30 } ,
1919+ } ,
19101920 context : None ,
19111921 } ,
19121922 ) ;
0 commit comments