@@ -30,6 +30,23 @@ impl RatomlTest {
3030 fixtures : Vec < & str > ,
3131 roots : Vec < & str > ,
3232 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 ,
3350 ) -> Self {
3451 let tmp_dir = TestDir :: new ( ) ;
3552 let tmp_path = tmp_dir. path ( ) . to_owned ( ) ;
@@ -46,7 +63,7 @@ impl RatomlTest {
4663 project = project. with_config ( client_config) ;
4764 }
4865
49- let server = project. server ( ) . wait_until_workspace_is_loaded ( ) ;
66+ let server = project. server_with_lock ( prelock ) . wait_until_workspace_is_loaded ( ) ;
5067
5168 let mut case = Self { urls : vec ! [ ] , server, tmp_path } ;
5269 let urls = fixtures. iter ( ) . map ( |fixture| case. fixture_path ( fixture) ) . collect :: < Vec < _ > > ( ) ;
@@ -72,7 +89,7 @@ impl RatomlTest {
7289 let mut spl = spl. into_iter ( ) ;
7390 if let Some ( first) = spl. next ( ) {
7491 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 ( ) ;
7693 } else {
7794 path = path. join ( first) ;
7895 }
@@ -285,16 +302,15 @@ enum Value {
285302// }
286303
287304#[ test]
288- #[ ignore = "the user config is currently not being watched on startup, fix this" ]
289305fn ratoml_user_config_detected ( ) {
290306 if skip_slow_tests ( ) {
291307 return ;
292308 }
293309
294- let server = RatomlTest :: new (
310+ let server = RatomlTest :: new_locked (
295311 vec ! [
296312 r#"
297- //- /$$CONFIG_DIR$$/rust-analyzer/rust-analyzer .toml
313+ //- /$$CONFIG_DIR$$/rust-analyzer.toml
298314assist.emitMustUse = true
299315"# ,
300316 r#"
@@ -322,13 +338,12 @@ enum Value {
322338}
323339
324340#[ test]
325- #[ ignore = "the user config is currently not being watched on startup, fix this" ]
326341fn ratoml_create_user_config ( ) {
327342 if skip_slow_tests ( ) {
328343 return ;
329344 }
330345
331- let mut server = RatomlTest :: new (
346+ let mut server = RatomlTest :: new_locked (
332347 vec ! [
333348 r#"
334349//- /p1/Cargo.toml
@@ -353,10 +368,7 @@ enum Value {
353368 1 ,
354369 InternalTestingFetchConfigResponse :: AssistEmitMustUse ( false ) ,
355370 ) ;
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 ( ) ) ;
360372 server. query (
361373 InternalTestingFetchConfigOption :: AssistEmitMustUse ,
362374 1 ,
@@ -365,13 +377,12 @@ enum Value {
365377}
366378
367379#[ test]
368- #[ ignore = "the user config is currently not being watched on startup, fix this" ]
369380fn ratoml_modify_user_config ( ) {
370381 if skip_slow_tests ( ) {
371382 return ;
372383 }
373384
374- let mut server = RatomlTest :: new (
385+ let mut server = RatomlTest :: new_locked (
375386 vec ! [
376387 r#"
377388//- /p1/Cargo.toml
@@ -386,7 +397,7 @@ enum Value {
386397 Text(String),
387398}"# ,
388399 r#"
389- //- /$$CONFIG_DIR$$/rust-analyzer/rust-analyzer .toml
400+ //- /$$CONFIG_DIR$$/rust-analyzer.toml
390401assist.emitMustUse = true"# ,
391402 ] ,
392403 vec ! [ "p1" ] ,
@@ -407,13 +418,12 @@ assist.emitMustUse = true"#,
407418}
408419
409420#[ test]
410- #[ ignore = "the user config is currently not being watched on startup, fix this" ]
411421fn ratoml_delete_user_config ( ) {
412422 if skip_slow_tests ( ) {
413423 return ;
414424 }
415425
416- let mut server = RatomlTest :: new (
426+ let mut server = RatomlTest :: new_locked (
417427 vec ! [
418428 r#"
419429//- /p1/Cargo.toml
@@ -428,7 +438,7 @@ enum Value {
428438 Text(String),
429439}"# ,
430440 r#"
431- //- /$$CONFIG_DIR$$/rust-analyzer/rust-analyzer .toml
441+ //- /$$CONFIG_DIR$$/rust-analyzer.toml
432442assist.emitMustUse = true"# ,
433443 ] ,
434444 vec ! [ "p1" ] ,
0 commit comments