diff --git a/python3/vimspector/utils.py b/python3/vimspector/utils.py index dff4c342..57cec0cb 100644 --- a/python3/vimspector/utils.py +++ b/python3/vimspector/utils.py @@ -672,7 +672,15 @@ def ExpandReferencesInString( orig_s, key = e.name + e.arg_hash if e.name in calculus: - mapping[ key ] = calculus[ e.name ]( *e.args ) + # Expand any recursive mappings in the args.... eeeek + new_args = [] + for arg in e.args: + new_args.append( ExpandReferencesInObject( arg, + mapping, + calculus, + user_choices ) ) + + mapping[ key ] = calculus[ e.name ]( *new_args ) _logger.debug( "Put %s into mapping for %s with args %s", key, e.name, diff --git a/tests/python/Test_ExpandReferencesInDict.py b/tests/python/Test_ExpandReferencesInDict.py index 1d552f6a..21fd0a9d 100644 --- a/tests/python/Test_ExpandReferencesInDict.py +++ b/tests/python/Test_ExpandReferencesInDict.py @@ -134,11 +134,15 @@ def test_ParseVariables( self ): 'in': { 'variables_list': { 'not_in_list': '${is_in_list( "x", [ "y", "z" ] )}', - 'in_list': '${is_in_list( "x", [ "y", "x", "z" ] )}', + 'in_list': '${is_in_list( "x", [ "${why}", "x", "z" ] )}', 'not_in_listj#json': '${is_in_list( "x", [ "y", "z" ] )}', - 'in_listj#json': '${is_in_list( "x", [ "y", "x", "z" ] )}', + 'in_listj#json': + '${is_in_list( "x", [ "${why}", "x", "${zed}" ] )}', + }, + 'mapping': { + 'why': 'y', + 'zed': 'z' }, - 'mapping': {}, 'calculus': { 'is_in_list': lambda needle, haystack: 'true' if needle in haystack else 'false'