From c93661f3d1ae27dbdec181dafce2efef739570b5 Mon Sep 17 00:00:00 2001 From: Tad Hardesty Date: Fri, 27 Nov 2020 17:35:24 -0800 Subject: [PATCH] Move Locals before Arguments in the scopes list (Auxtools) --- src/langserver/debugger/mod.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/langserver/debugger/mod.rs b/src/langserver/debugger/mod.rs index 9b40b30b..bcac4204 100644 --- a/src/langserver/debugger/mod.rs +++ b/src/langserver/debugger/mod.rs @@ -1024,16 +1024,8 @@ handle_request! { } DebugClient::Auxtools(auxtools) => { - let (arguments, locals, globals) = auxtools.get_scopes( frameId as u32 )?; - let mut scopes = vec![]; - - if let Some(arguments) = arguments { - scopes.push(Scope { - name: "Arguments".to_owned(), - variablesReference: arguments.0 as i64, - .. Default::default() - }); - } + let (arguments, locals, globals) = auxtools.get_scopes(frameId as u32)?; + let mut scopes = Vec::with_capacity(locals.is_some() as usize + arguments.is_some() as usize + globals.is_some() as usize); if let Some(locals) = locals { scopes.push(Scope { @@ -1043,6 +1035,14 @@ handle_request! { }); } + if let Some(arguments) = arguments { + scopes.push(Scope { + name: "Arguments".to_owned(), + variablesReference: arguments.0 as i64, + .. Default::default() + }); + } + if let Some(globals) = globals { scopes.push(Scope { name: "Globals".to_owned(),