From fe60fb8679c32f134a13c9cf5867c1dc6e7d2332 Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Sun, 7 May 2023 07:29:15 -0500 Subject: [PATCH] resolve standard library before ide commands (#9126) # Description This PR moves loading the standard library before the ide commands are executed in hopes that the standard library will no longer give check errors. I'm not sure if this will be a big performance impact or not. We'll have to try it and see. # User-Facing Changes # Tests + Formatting # After Submitting --- src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index c158c8393d..0e7f592ba3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -152,6 +152,10 @@ fn main() -> Result<()> { engine_state.add_env_var("NU_LIB_DIRS".into(), Value::List { vals, span }); } + if parsed_nu_cli_args.no_std_lib.is_none() { + load_standard_library(&mut engine_state)?; + } + // IDE commands if let Some(ide_goto_def) = parsed_nu_cli_args.ide_goto_def { ide::goto_def(&mut engine_state, &script_name, &ide_goto_def); @@ -251,10 +255,6 @@ fn main() -> Result<()> { use_color, ); - if parsed_nu_cli_args.no_std_lib.is_none() { - load_standard_library(&mut engine_state)?; - } - if let Some(commands) = parsed_nu_cli_args.commands.clone() { run_commands( &mut engine_state,