add completions to ${...}

This commit is contained in:
Gil Forsyth 2016-05-24 11:24:13 -04:00
parent 97f9766e62
commit 6a3111f334
2 changed files with 5 additions and 3 deletions

View file

@ -11,6 +11,8 @@ Current Developments
* Added comma literals to subproc mode.
* ``@$(cmd)`` has been added as a subprocess-mode operator, which replaces in
the subprocess command itself with the result of running ``cmd``.
* The ``${...}`` shortcut for ``__xonsh_env__`` now returns appropriate
completion options
**Changed:**

View file

@ -526,11 +526,11 @@ class Completer(object):
expr = subexpr_from_unbalanced(expr, '{', '}')
_ctx = None
try:
val = eval(expr, ctx)
val = builtins.__xonsh_execer__.eval(expr, ctx)
_ctx = ctx
except: # pylint:disable=bare-except
try:
val = eval(expr, builtins.__dict__)
val = builtins.__xonsh_execer__.eval(expr, builtins.__dict__)
_ctx = builtins.__dict__
except: # pylint:disable=bare-except
return attrs # anything could have gone wrong!
@ -539,7 +539,7 @@ class Completer(object):
opts = []
for i in _opts:
try:
eval('{0}.{1}'.format(expr, i), _ctx)
builtins.__xonsh_execer__.eval('{0}.{1}'.format(expr, i), _ctx)
except: # pylint:disable=bare-except
continue
else: