Remove debugging

This commit is contained in:
Filip Tibell 2023-08-20 14:02:48 -05:00
parent 3ab15e63e8
commit a8db74d40d
2 changed files with 0 additions and 11 deletions

View file

@ -15,13 +15,11 @@ where
let (abs_path, rel_path) = ctx.resolve_paths(source, path)?; let (abs_path, rel_path) = ctx.resolve_paths(source, path)?;
// 1. Try to require the exact path // 1. Try to require the exact path
println!("1. REQUIRE: Exact");
if let Ok(res) = require_inner(ctx, &abs_path, &rel_path).await { if let Ok(res) = require_inner(ctx, &abs_path, &rel_path).await {
return Ok(res); return Ok(res);
} }
// 2. Try to require the path with an added "luau" extension // 2. Try to require the path with an added "luau" extension
println!("2. REQUIRE: Luau extension");
let (luau_abs_path, luau_rel_path) = ( let (luau_abs_path, luau_rel_path) = (
append_extension(&abs_path, "luau"), append_extension(&abs_path, "luau"),
append_extension(&rel_path, "luau"), append_extension(&rel_path, "luau"),
@ -31,7 +29,6 @@ where
} }
// 2. Try to require the path with an added "lua" extension // 2. Try to require the path with an added "lua" extension
println!("3. REQUIRE: Lua extension");
let (lua_abs_path, lua_rel_path) = ( let (lua_abs_path, lua_rel_path) = (
append_extension(&abs_path, "lua"), append_extension(&abs_path, "lua"),
append_extension(&rel_path, "lua"), append_extension(&rel_path, "lua"),
@ -41,7 +38,6 @@ where
} }
// Nothing left to try, throw an error // Nothing left to try, throw an error
println!("4. REQUIRE: Error");
Err(LuaError::runtime(format!( Err(LuaError::runtime(format!(
"No file exist at the path '{}'", "No file exist at the path '{}'",
rel_path.display() rel_path.display()
@ -60,13 +56,10 @@ where
let rel_path = rel_path.as_ref(); let rel_path = rel_path.as_ref();
if ctx.is_cached(abs_path)? { if ctx.is_cached(abs_path)? {
println!("Found cached, fetching from cache");
ctx.get_from_cache(abs_path) ctx.get_from_cache(abs_path)
} else if ctx.is_pending(abs_path)? { } else if ctx.is_pending(abs_path)? {
println!("Found pending, waiting for cache");
ctx.wait_for_cache(&abs_path).await ctx.wait_for_cache(&abs_path).await
} else { } else {
println!("No cached, loading new");
ctx.load_with_caching(&abs_path, &rel_path).await ctx.load_with_caching(&abs_path, &rel_path).await
} }
} }

View file

@ -130,9 +130,7 @@ where
loop { loop {
// 1. Run lua threads until exit or there are none left, // 1. Run lua threads until exit or there are none left,
// if any thread was resumed it may have spawned futures // if any thread was resumed it may have spawned futures
println!("Resuming lua");
let resumed_lua = self.run_lua_threads(); let resumed_lua = self.run_lua_threads();
println!("Resumed lua");
// 2. If we got a manual exit code from lua we should // 2. If we got a manual exit code from lua we should
// not try to wait for any pending futures to complete // not try to wait for any pending futures to complete
@ -142,9 +140,7 @@ where
// 3. Keep resuming futures until we get a new lua thread to // 3. Keep resuming futures until we get a new lua thread to
// resume, or until we don't have any futures left to wait for // resume, or until we don't have any futures left to wait for
println!("Resuming futures");
let resumed_fut = self.run_futures().await; let resumed_fut = self.run_futures().await;
println!("Resumed futures");
// 4. If we did not resume any lua threads, and we have no futures // 4. If we did not resume any lua threads, and we have no futures
// remaining either, we have now run the scheduler until completion // remaining either, we have now run the scheduler until completion