@@ -30,6 +30,23 @@ impl RatomlTest {
30
30
fixtures : Vec < & str > ,
31
31
roots : Vec < & str > ,
32
32
client_config : Option < serde_json:: Value > ,
33
+ ) -> Self {
34
+ RatomlTest :: new_with_lock ( fixtures, roots, client_config, false )
35
+ }
36
+
37
+ fn new_locked (
38
+ fixtures : Vec < & str > ,
39
+ roots : Vec < & str > ,
40
+ client_config : Option < serde_json:: Value > ,
41
+ ) -> Self {
42
+ RatomlTest :: new_with_lock ( fixtures, roots, client_config, true )
43
+ }
44
+
45
+ fn new_with_lock (
46
+ fixtures : Vec < & str > ,
47
+ roots : Vec < & str > ,
48
+ client_config : Option < serde_json:: Value > ,
49
+ prelock : bool ,
33
50
) -> Self {
34
51
let tmp_dir = TestDir :: new ( ) ;
35
52
let tmp_path = tmp_dir. path ( ) . to_owned ( ) ;
@@ -46,7 +63,7 @@ impl RatomlTest {
46
63
project = project. with_config ( client_config) ;
47
64
}
48
65
49
- let server = project. server ( ) . wait_until_workspace_is_loaded ( ) ;
66
+ let server = project. server_with_lock ( prelock ) . wait_until_workspace_is_loaded ( ) ;
50
67
51
68
let mut case = Self { urls : vec ! [ ] , server, tmp_path } ;
52
69
let urls = fixtures. iter ( ) . map ( |fixture| case. fixture_path ( fixture) ) . collect :: < Vec < _ > > ( ) ;
@@ -72,7 +89,7 @@ impl RatomlTest {
72
89
let mut spl = spl. into_iter ( ) ;
73
90
if let Some ( first) = spl. next ( ) {
74
91
if first == "$$CONFIG_DIR$$" {
75
- path = Config :: user_config_path ( ) . unwrap ( ) . to_path_buf ( ) . into ( ) ;
92
+ path = Config :: user_config_dir_path ( ) . unwrap ( ) . to_path_buf ( ) . into ( ) ;
76
93
} else {
77
94
path = path. join ( first) ;
78
95
}
@@ -285,16 +302,15 @@ enum Value {
285
302
// }
286
303
287
304
#[ test]
288
- #[ ignore = "the user config is currently not being watched on startup, fix this" ]
289
305
fn ratoml_user_config_detected ( ) {
290
306
if skip_slow_tests ( ) {
291
307
return ;
292
308
}
293
309
294
- let server = RatomlTest :: new (
310
+ let server = RatomlTest :: new_locked (
295
311
vec ! [
296
312
r#"
297
- //- /$$CONFIG_DIR$$/rust-analyzer/rust-analyzer .toml
313
+ //- /$$CONFIG_DIR$$/rust-analyzer.toml
298
314
assist.emitMustUse = true
299
315
"# ,
300
316
r#"
@@ -322,13 +338,12 @@ enum Value {
322
338
}
323
339
324
340
#[ test]
325
- #[ ignore = "the user config is currently not being watched on startup, fix this" ]
326
341
fn ratoml_create_user_config ( ) {
327
342
if skip_slow_tests ( ) {
328
343
return ;
329
344
}
330
345
331
- let mut server = RatomlTest :: new (
346
+ let mut server = RatomlTest :: new_locked (
332
347
vec ! [
333
348
r#"
334
349
//- /p1/Cargo.toml
@@ -353,10 +368,7 @@ enum Value {
353
368
1 ,
354
369
InternalTestingFetchConfigResponse :: AssistEmitMustUse ( false ) ,
355
370
) ;
356
- server. create (
357
- "//- /$$CONFIG_DIR$$/rust-analyzer/rust-analyzer.toml" ,
358
- RatomlTest :: EMIT_MUST_USE . to_owned ( ) ,
359
- ) ;
371
+ server. create ( "//- /$$CONFIG_DIR$$/rust-analyzer.toml" , RatomlTest :: EMIT_MUST_USE . to_owned ( ) ) ;
360
372
server. query (
361
373
InternalTestingFetchConfigOption :: AssistEmitMustUse ,
362
374
1 ,
@@ -365,13 +377,12 @@ enum Value {
365
377
}
366
378
367
379
#[ test]
368
- #[ ignore = "the user config is currently not being watched on startup, fix this" ]
369
380
fn ratoml_modify_user_config ( ) {
370
381
if skip_slow_tests ( ) {
371
382
return ;
372
383
}
373
384
374
- let mut server = RatomlTest :: new (
385
+ let mut server = RatomlTest :: new_locked (
375
386
vec ! [
376
387
r#"
377
388
//- /p1/Cargo.toml
@@ -386,7 +397,7 @@ enum Value {
386
397
Text(String),
387
398
}"# ,
388
399
r#"
389
- //- /$$CONFIG_DIR$$/rust-analyzer/rust-analyzer .toml
400
+ //- /$$CONFIG_DIR$$/rust-analyzer.toml
390
401
assist.emitMustUse = true"# ,
391
402
] ,
392
403
vec ! [ "p1" ] ,
@@ -407,13 +418,12 @@ assist.emitMustUse = true"#,
407
418
}
408
419
409
420
#[ test]
410
- #[ ignore = "the user config is currently not being watched on startup, fix this" ]
411
421
fn ratoml_delete_user_config ( ) {
412
422
if skip_slow_tests ( ) {
413
423
return ;
414
424
}
415
425
416
- let mut server = RatomlTest :: new (
426
+ let mut server = RatomlTest :: new_locked (
417
427
vec ! [
418
428
r#"
419
429
//- /p1/Cargo.toml
@@ -428,7 +438,7 @@ enum Value {
428
438
Text(String),
429
439
}"# ,
430
440
r#"
431
- //- /$$CONFIG_DIR$$/rust-analyzer/rust-analyzer .toml
441
+ //- /$$CONFIG_DIR$$/rust-analyzer.toml
432
442
assist.emitMustUse = true"# ,
433
443
] ,
434
444
vec ! [ "p1" ] ,
0 commit comments