@@ -439,9 +439,11 @@ fn client_test_complete_self_crate_name() {
439
439
trigger_character : Some ( ":" . to_string ( ) ) ,
440
440
trigger_kind : CompletionTriggerKind :: TriggerCharacter ,
441
441
} ) ,
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
+ } ,
445
447
} ,
446
448
} ,
447
449
) ;
@@ -537,9 +539,11 @@ fn client_completion_suggests_arguments_in_statements() {
537
539
trigger_character : Some ( "f" . to_string ( ) ) ,
538
540
trigger_kind : CompletionTriggerKind :: TriggerCharacter ,
539
541
} ) ,
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
+ } ,
543
547
} ,
544
548
} ,
545
549
) ;
@@ -603,9 +607,11 @@ fn client_use_statement_completion_doesnt_suggest_arguments() {
603
607
trigger_character : Some ( ":" . to_string ( ) ) ,
604
608
trigger_kind : CompletionTriggerKind :: TriggerCharacter ,
605
609
} ) ,
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
+ } ,
609
615
} ,
610
616
} ,
611
617
) ;
@@ -1153,13 +1159,10 @@ fn client_deglob() {
1153
1159
// Right now we only support deglobbing via commands. Please update this
1154
1160
// test if we move to making text edits via CodeAction (which we should for
1155
1161
// 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
+ } ;
1163
1166
1164
1167
let arguments = arguments. expect ( "Missing command arguments" ) ;
1165
1168
@@ -1214,13 +1217,10 @@ fn client_deglob() {
1214
1217
// Right now we only support deglobbing via commands. Please update this
1215
1218
// test if we move to making text edits via CodeAction (which we should for
1216
1219
// 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
+ } ;
1224
1224
1225
1225
let arguments = arguments. expect ( "Missing command arguments" ) ;
1226
1226
@@ -1605,10 +1605,12 @@ fn client_find_all_refs_test() {
1605
1605
. request :: < References > (
1606
1606
42 ,
1607
1607
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 } ,
1610
1613
} ,
1611
- position : Position { line : 0 , character : 7 } ,
1612
1614
context : ReferenceContext { include_declaration : true } ,
1613
1615
} ,
1614
1616
)
@@ -1643,10 +1645,12 @@ fn client_find_all_refs_no_cfg_test() {
1643
1645
. request :: < References > (
1644
1646
42 ,
1645
1647
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 } ,
1648
1653
} ,
1649
- position : Position { line : 0 , character : 7 } ,
1650
1654
context : ReferenceContext { include_declaration : true } ,
1651
1655
} ,
1652
1656
)
@@ -1730,9 +1734,11 @@ fn client_rename() {
1730
1734
. request :: < Rename > (
1731
1735
42 ,
1732
1736
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
+ } ,
1736
1742
} ,
1737
1743
new_name : "foo" . to_owned ( ) ,
1738
1744
} ,
@@ -1895,8 +1901,10 @@ fn client_completion() {
1895
1901
let result = rls. request :: < Completion > (
1896
1902
11 ,
1897
1903
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
+ } ,
1900
1908
context : None ,
1901
1909
} ,
1902
1910
) ;
@@ -1905,8 +1913,10 @@ fn client_completion() {
1905
1913
let result = rls. request :: < Completion > (
1906
1914
11 ,
1907
1915
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
+ } ,
1910
1920
context : None ,
1911
1921
} ,
1912
1922
) ;
0 commit comments