about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2022-04-27 18:25:12 +0200
committerLukas Wirth <lukastw97@gmail.com>2022-05-01 19:57:09 +0200
commit9fe1b24736c8390364d8fdfdb35c6611e29eaf13 (patch)
treef2f16ef372336e6e04ba9148c1713027273e4550
parent3d17261972fcf5f55660a6e2889608142426d5c3 (diff)
Update config usage in slow tests
-rw-r--r--crates/rust-analyzer/src/config.rs2
-rw-r--r--crates/rust-analyzer/tests/slow-tests/main.rs10
-rw-r--r--crates/rust-analyzer/tests/slow-tests/support.rs6
3 files changed, 12 insertions, 6 deletions
diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs
index 7dc25c1e6d7..1af59cfebee 100644
--- a/crates/rust-analyzer/src/config.rs
+++ b/crates/rust-analyzer/src/config.rs
@@ -525,6 +525,7 @@ pub struct ClientCommandsConfig {
     pub trigger_parameter_hints: bool,
 }
 
+#[derive(Debug)]
 pub struct ConfigUpdateError {
     errors: Vec<(String, serde_json::Error)>,
 }
@@ -1442,7 +1443,6 @@ fn get_field<T: DeserializeOwned>(
     default: &str,
 ) -> T {
     let default = serde_json::from_str(default).unwrap();
-
     // XXX: check alias first, to work-around the VS Code where it pre-fills the
     // defaults instead of sending an empty object.
     alias
diff --git a/crates/rust-analyzer/tests/slow-tests/main.rs b/crates/rust-analyzer/tests/slow-tests/main.rs
index 147e8c141a2..143b63e11c5 100644
--- a/crates/rust-analyzer/tests/slow-tests/main.rs
+++ b/crates/rust-analyzer/tests/slow-tests/main.rs
@@ -685,7 +685,7 @@ version = \"0.0.0\"
 #[test]
 fn out_dirs_check() {
     if skip_slow_tests() {
-        return;
+        // return;
     }
 
     let server = Project::with_fixture(
@@ -737,7 +737,9 @@ fn main() {
     )
     .with_config(serde_json::json!({
         "cargo": {
-            "loadOutDirsFromCheck": true,
+            "buildScripts": {
+                "enable": true
+            },
             "noSysroot": true,
         }
     }))
@@ -890,7 +892,9 @@ pub fn foo(_input: TokenStream) -> TokenStream {
     )
     .with_config(serde_json::json!({
         "cargo": {
-            "loadOutDirsFromCheck": true,
+            "buildScripts": {
+                "enable": true
+            },
             "noSysroot": true,
         },
         "procMacro": {
diff --git a/crates/rust-analyzer/tests/slow-tests/support.rs b/crates/rust-analyzer/tests/slow-tests/support.rs
index 515cdfdc7c6..36bffe3210e 100644
--- a/crates/rust-analyzer/tests/slow-tests/support.rs
+++ b/crates/rust-analyzer/tests/slow-tests/support.rs
@@ -36,7 +36,9 @@ impl<'a> Project<'a> {
                     // Loading standard library is costly, let's ignore it by default
                     "noSysroot": true,
                     // Can't use test binary as rustc wrapper.
-                    "useRustcWrapperForBuildScripts": false,
+                    "buildScripts": {
+                        "useRustcWrapper": false
+                    },
                 }
             }),
         }
@@ -137,7 +139,7 @@ impl<'a> Project<'a> {
             },
         );
         config.discovered_projects = Some(discovered_projects);
-        let _ = config.update(self.config);
+        config.update(self.config).expect("invalid config");
 
         Server::new(tmp_dir, config)
     }