@@ -96,7 +96,7 @@ fn notification<A: ls_server::BlockingNotificationAction>(params: A::Params) ->
96
96
97
97
#[ test]
98
98
fn test_shutdown ( ) {
99
- let mut env = Environment :: new ( "common" ) ;
99
+ let mut env = Environment :: generate_from_fixture ( "common" ) ;
100
100
101
101
let root_path = env. cache . abs_path ( Path :: new ( "." ) ) ;
102
102
@@ -129,7 +129,7 @@ fn test_shutdown() {
129
129
130
130
#[ test]
131
131
fn test_goto_def ( ) {
132
- let mut env = Environment :: new ( "common" ) ;
132
+ let mut env = Environment :: generate_from_fixture ( "common" ) ;
133
133
134
134
let source_file_path = Path :: new ( "src" ) . join ( "main.rs" ) ;
135
135
@@ -179,7 +179,7 @@ fn test_goto_def() {
179
179
180
180
#[ test]
181
181
fn test_hover ( ) {
182
- let mut env = Environment :: new ( "common" ) ;
182
+ let mut env = Environment :: generate_from_fixture ( "common" ) ;
183
183
184
184
let source_file_path = Path :: new ( "src" ) . join ( "main.rs" ) ;
185
185
@@ -229,7 +229,7 @@ fn test_hover() {
229
229
/// Test hover continues to work after the source has moved line
230
230
#[ test]
231
231
fn test_hover_after_src_line_change ( ) {
232
- let mut env = Environment :: new ( "common" ) ;
232
+ let mut env = Environment :: generate_from_fixture ( "common" ) ;
233
233
234
234
let source_file_path = Path :: new ( "src" ) . join ( "main.rs" ) ;
235
235
@@ -330,7 +330,7 @@ fn test_hover_after_src_line_change() {
330
330
331
331
#[ test]
332
332
fn test_workspace_symbol ( ) {
333
- let mut env = Environment :: new ( "workspace_symbol" ) ;
333
+ let mut env = Environment :: generate_from_fixture ( "workspace_symbol" ) ;
334
334
335
335
let root_path = env. cache . abs_path ( Path :: new ( "." ) ) ;
336
336
@@ -386,7 +386,7 @@ fn test_workspace_symbol() {
386
386
387
387
#[ test]
388
388
fn test_workspace_symbol_duplicates ( ) {
389
- let mut env = Environment :: new ( "workspace_symbol_duplicates" ) ;
389
+ let mut env = Environment :: generate_from_fixture ( "workspace_symbol_duplicates" ) ;
390
390
391
391
let root_path = env. cache . abs_path ( Path :: new ( "." ) ) ;
392
392
@@ -444,7 +444,7 @@ fn test_workspace_symbol_duplicates() {
444
444
445
445
#[ test]
446
446
fn test_find_all_refs ( ) {
447
- let mut env = Environment :: new ( "common" ) ;
447
+ let mut env = Environment :: generate_from_fixture ( "common" ) ;
448
448
449
449
let source_file_path = Path :: new ( "src" ) . join ( "main.rs" ) ;
450
450
@@ -501,7 +501,7 @@ fn test_find_all_refs() {
501
501
502
502
#[ test]
503
503
fn test_find_all_refs_no_cfg_test ( ) {
504
- let mut env = Environment :: new ( "find_all_refs_no_cfg_test" ) ;
504
+ let mut env = Environment :: generate_from_fixture ( "find_all_refs_no_cfg_test" ) ;
505
505
env. with_config ( |c| c. all_targets = false ) ;
506
506
507
507
let source_file_path = Path :: new ( "src" ) . join ( "main.rs" ) ;
@@ -556,7 +556,7 @@ fn test_find_all_refs_no_cfg_test() {
556
556
557
557
#[ test]
558
558
fn test_borrow_error ( ) {
559
- let mut env = Environment :: new ( "borrow_error" ) ;
559
+ let mut env = Environment :: generate_from_fixture ( "borrow_error" ) ;
560
560
561
561
let root_path = env. cache . abs_path ( Path :: new ( "." ) ) ;
562
562
let messages =
@@ -588,7 +588,7 @@ fn test_borrow_error() {
588
588
589
589
#[ test]
590
590
fn test_highlight ( ) {
591
- let mut env = Environment :: new ( "common" ) ;
591
+ let mut env = Environment :: generate_from_fixture ( "common" ) ;
592
592
593
593
let source_file_path = Path :: new ( "src" ) . join ( "main.rs" ) ;
594
594
@@ -641,7 +641,7 @@ fn test_highlight() {
641
641
642
642
#[ test]
643
643
fn test_rename ( ) {
644
- let mut env = Environment :: new ( "common" ) ;
644
+ let mut env = Environment :: generate_from_fixture ( "common" ) ;
645
645
646
646
let source_file_path = Path :: new ( "src" ) . join ( "main.rs" ) ;
647
647
@@ -696,7 +696,7 @@ fn test_rename() {
696
696
697
697
#[ test]
698
698
fn test_reformat ( ) {
699
- let mut env = Environment :: new ( "reformat" ) ;
699
+ let mut env = Environment :: generate_from_fixture ( "reformat" ) ;
700
700
701
701
let source_file_path = Path :: new ( "src" ) . join ( "main.rs" ) ;
702
702
@@ -748,7 +748,7 @@ fn test_reformat() {
748
748
749
749
#[ test]
750
750
fn test_reformat_with_range ( ) {
751
- let mut env = Environment :: new ( "reformat_with_range" ) ;
751
+ let mut env = Environment :: generate_from_fixture ( "reformat_with_range" ) ;
752
752
let source_file_path = Path :: new ( "src" ) . join ( "main.rs" ) ;
753
753
754
754
let root_path = env. cache . abs_path ( Path :: new ( "." ) ) ;
@@ -809,7 +809,7 @@ fn test_reformat_with_range() {
809
809
810
810
#[ test]
811
811
fn test_multiple_binaries ( ) {
812
- let mut env = Environment :: new ( "multiple_bins" ) ;
812
+ let mut env = Environment :: generate_from_fixture ( "multiple_bins" ) ;
813
813
814
814
let root_path = env. cache . abs_path ( Path :: new ( "." ) ) ;
815
815
let messages =
@@ -849,7 +849,7 @@ fn test_multiple_binaries() {
849
849
// FIXME Requires rust-src component, which would break Rust CI
850
850
// #[test]
851
851
// fn test_completion() {
852
- // let mut env = Environment::new ("common");
852
+ // let mut env = Environment::generate_from_fixture ("common");
853
853
854
854
// let source_file_path = Path::new("src").join("main.rs");
855
855
@@ -888,7 +888,7 @@ fn test_multiple_binaries() {
888
888
889
889
#[ test]
890
890
fn test_bin_lib_project ( ) {
891
- let mut env = Environment :: new ( "bin_lib" ) ;
891
+ let mut env = Environment :: generate_from_fixture ( "bin_lib" ) ;
892
892
893
893
let root_path = env. cache . abs_path ( Path :: new ( "." ) ) ;
894
894
@@ -933,7 +933,7 @@ fn test_bin_lib_project() {
933
933
// FIXME(#524) timing issues when run concurrently with `test_bin_lib_project`
934
934
// #[test]
935
935
// fn test_bin_lib_project_no_cfg_test() {
936
- // let mut env = Environment::new ("bin_lib");
936
+ // let mut env = Environment::generate_from_fixture ("bin_lib");
937
937
938
938
// let root_path = env.cache.abs_path(Path::new("."));
939
939
@@ -958,7 +958,7 @@ fn test_bin_lib_project() {
958
958
// FIXME(#455) reinstate this test
959
959
// #[test]
960
960
// fn test_simple_workspace() {
961
- // let mut env = Environment::new ("simple_workspace");
961
+ // let mut env = Environment::generate_from_fixture ("simple_workspace");
962
962
963
963
// let root_path = env.cache.abs_path(Path::new("."));
964
964
@@ -982,7 +982,7 @@ fn test_bin_lib_project() {
982
982
983
983
#[ test]
984
984
fn test_infer_lib ( ) {
985
- let mut env = Environment :: new ( "infer_lib" ) ;
985
+ let mut env = Environment :: generate_from_fixture ( "infer_lib" ) ;
986
986
987
987
let root_path = env. cache . abs_path ( Path :: new ( "." ) ) ;
988
988
let messages =
@@ -1018,7 +1018,7 @@ fn test_infer_lib() {
1018
1018
1019
1019
#[ test]
1020
1020
fn test_infer_bin ( ) {
1021
- let mut env = Environment :: new ( "infer_bin" ) ;
1021
+ let mut env = Environment :: generate_from_fixture ( "infer_bin" ) ;
1022
1022
1023
1023
let root_path = env. cache . abs_path ( Path :: new ( "." ) ) ;
1024
1024
let messages =
@@ -1054,7 +1054,7 @@ fn test_infer_bin() {
1054
1054
1055
1055
#[ test]
1056
1056
fn test_infer_custom_bin ( ) {
1057
- let mut env = Environment :: new ( "infer_custom_bin" ) ;
1057
+ let mut env = Environment :: generate_from_fixture ( "infer_custom_bin" ) ;
1058
1058
1059
1059
let root_path = env. cache . abs_path ( Path :: new ( "." ) ) ;
1060
1060
let messages =
@@ -1093,7 +1093,7 @@ fn test_infer_custom_bin() {
1093
1093
fn test_omit_init_build ( ) {
1094
1094
use serde_json:: json;
1095
1095
1096
- let mut env = Environment :: new ( "common" ) ;
1096
+ let mut env = Environment :: generate_from_fixture ( "common" ) ;
1097
1097
1098
1098
let root_path = env. cache . abs_path ( Path :: new ( "." ) ) ;
1099
1099
let root_path = root_path. as_os_str ( ) . to_str ( ) . map ( |x| x. to_owned ( ) ) ;
@@ -1120,7 +1120,7 @@ fn test_omit_init_build() {
1120
1120
fn test_init_with_configuration ( ) {
1121
1121
use serde_json:: json;
1122
1122
1123
- let mut env = Environment :: new ( "common" ) ;
1123
+ let mut env = Environment :: generate_from_fixture ( "common" ) ;
1124
1124
1125
1125
let root_path = env. cache . abs_path ( Path :: new ( "." ) ) ;
1126
1126
let root_path = root_path. as_os_str ( ) . to_str ( ) . map ( |x| x. to_owned ( ) ) ;
@@ -1196,7 +1196,7 @@ fn test_parse_error_on_malformed_input() {
1196
1196
1197
1197
#[ test]
1198
1198
fn test_find_impls ( ) {
1199
- let mut env = Environment :: new ( "find_impls" ) ;
1199
+ let mut env = Environment :: generate_from_fixture ( "find_impls" ) ;
1200
1200
1201
1201
let source_file_path = Path :: new ( "src" ) . join ( "main.rs" ) ;
1202
1202
@@ -1292,7 +1292,7 @@ fn test_find_impls() {
1292
1292
1293
1293
#[ test]
1294
1294
fn test_features ( ) {
1295
- let mut env = Environment :: new ( "features" ) ;
1295
+ let mut env = Environment :: generate_from_fixture ( "features" ) ;
1296
1296
1297
1297
let root_path = env. cache . abs_path ( Path :: new ( "." ) ) ;
1298
1298
let messages =
@@ -1331,7 +1331,7 @@ fn test_features() {
1331
1331
1332
1332
#[ test]
1333
1333
fn test_all_features ( ) {
1334
- let mut env = Environment :: new ( "features" ) ;
1334
+ let mut env = Environment :: generate_from_fixture ( "features" ) ;
1335
1335
1336
1336
let root_path = env. cache . abs_path ( Path :: new ( "." ) ) ;
1337
1337
let messages =
@@ -1355,7 +1355,7 @@ fn test_all_features() {
1355
1355
1356
1356
#[ test]
1357
1357
fn test_no_default_features ( ) {
1358
- let mut env = Environment :: new ( "features" ) ;
1358
+ let mut env = Environment :: generate_from_fixture ( "features" ) ;
1359
1359
1360
1360
let root_path = env. cache . abs_path ( Path :: new ( "." ) ) ;
1361
1361
let messages =
@@ -1397,7 +1397,7 @@ fn test_no_default_features() {
1397
1397
1398
1398
// #[test]
1399
1399
// fn test_handle_utf8_directory() {
1400
- // let mut env = Environment::new ("unicødë");
1400
+ // let mut env = Environment::generate_from_fixture ("unicødë");
1401
1401
//
1402
1402
// let root_path = env.cache.abs_path(Path::new("."));
1403
1403
// let root_url = Url::from_directory_path(&root_path).unwrap();
@@ -1419,7 +1419,7 @@ fn test_no_default_features() {
1419
1419
1420
1420
#[ test]
1421
1421
fn test_deglob ( ) {
1422
- let mut env = Environment :: new ( "deglob" ) ;
1422
+ let mut env = Environment :: generate_from_fixture ( "deglob" ) ;
1423
1423
1424
1424
let source_file_path = Path :: new ( "src" ) . join ( "main.rs" ) ;
1425
1425
@@ -1638,7 +1638,7 @@ fn test_deglob() {
1638
1638
1639
1639
#[ test]
1640
1640
fn test_all_targets ( ) {
1641
- let mut env = Environment :: new ( "bin_lib" ) ;
1641
+ let mut env = Environment :: generate_from_fixture ( "bin_lib" ) ;
1642
1642
1643
1643
let root_path = env. cache . abs_path ( Path :: new ( "." ) ) ;
1644
1644
@@ -1683,7 +1683,7 @@ fn test_all_targets() {
1683
1683
/// continuing to run
1684
1684
#[ test]
1685
1685
fn ignore_uninitialized_notification ( ) {
1686
- let mut env = Environment :: new ( "common" ) ;
1686
+ let mut env = Environment :: generate_from_fixture ( "common" ) ;
1687
1687
1688
1688
let source_file_path = Path :: new ( "src" ) . join ( "main.rs" ) ;
1689
1689
@@ -1741,7 +1741,7 @@ fn ignore_uninitialized_notification() {
1741
1741
/// and continuing to run
1742
1742
#[ test]
1743
1743
fn fail_uninitialized_request ( ) {
1744
- let mut env = Environment :: new ( "common" ) ;
1744
+ let mut env = Environment :: generate_from_fixture ( "common" ) ;
1745
1745
1746
1746
let source_file_path = Path :: new ( "src" ) . join ( "main.rs" ) ;
1747
1747
let root_path = env. cache . abs_path ( Path :: new ( "." ) ) ;
@@ -1798,7 +1798,7 @@ fn fail_uninitialized_request() {
1798
1798
// FIXME disabled since it is failing in the Rust repo.
1799
1799
// #[test]
1800
1800
// fn test_dep_fail() {
1801
- // let mut env = Environment::new ("dep_fail");
1801
+ // let mut env = Environment::generate_from_fixture ("dep_fail");
1802
1802
1803
1803
// let root_path = env.cache.abs_path(Path::new("."));
1804
1804
0 commit comments