diff --git a/src/server/hot_reload.rs b/src/server/hot_reload.rs index a0eb43e08..7c9a6957e 100644 --- a/src/server/hot_reload.rs +++ b/src/server/hot_reload.rs @@ -97,7 +97,7 @@ pub async fn hot_reload_handler( if let DiffResult::RsxChanged(changed) = find_rsx(&new_file, &old_file) { for (old, new) in changed.into_iter() { let hr = get_location( - k.strip_prefix(&state.watcher_config.crate_dir).unwrap(), + k, old.to_token_stream(), ); // get the original source code to preserve whitespace diff --git a/src/server/mod.rs b/src/server/mod.rs index 16401aa85..8cdd76373 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -121,10 +121,7 @@ pub async fn startup_hot_reload(config: CrateConfig) -> Result<()> { log::info!("reloading rsx"); for (old, new) in changed.into_iter() { let hr = get_location( - &path - .strip_prefix(&crate_dir) - .unwrap() - .to_path_buf(), + &path.to_path_buf(), old.to_token_stream(), ); // get the original source code to preserve whitespace