From fc7725fefb8d67b704a124ea8debb4d9afa7cffb Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Sat, 11 Jul 2020 22:01:04 +0100 Subject: [PATCH] Only expand one inexpensive scope; codeLLDB lies about how expensive things are --- python3/vimspector/variables.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python3/vimspector/variables.py b/python3/vimspector/variables.py index 1cbf599..4186f68 100644 --- a/python3/vimspector/variables.py +++ b/python3/vimspector/variables.py @@ -205,6 +205,7 @@ class VariablesView( object ): def LoadScopes( self, frame ): def scopes_consumer( message ): new_scopes = [] + expanded_some_scope = False for scope_body in message[ 'body' ][ 'scopes' ]: # Find it in the scopes list found = False @@ -221,9 +222,12 @@ class VariablesView( object ): new_scopes.append( scope ) - if not scope.scope.get( 'expensive' ) and not scope.IsCollapsedByUser(): - # Expand any non-expensive scope which is not manually collapsed + # Expand the first non-expensive scope which is not manually collapsed + if ( not expanded_some_scope + and not scope.scope.get( 'expensive' ) + and not scope.IsCollapsedByUser() ): scope.expanded = True + expanded_some_scope = True if scope.IsExpandedByUser(): self._connection.DoRequest( partial( self._ConsumeVariables,