diff --git a/news/jedierr.rst b/news/jedierr.rst new file mode 100644 index 000000000..e258a5680 --- /dev/null +++ b/news/jedierr.rst @@ -0,0 +1,24 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Fixed issue with Jedi xontrib incorrectly raising errors + during tab completion. + +**Security:** + +* diff --git a/xontrib/jedi.xsh b/xontrib/jedi.xsh index b1e50c18c..5588514db 100644 --- a/xontrib/jedi.xsh +++ b/xontrib/jedi.xsh @@ -31,10 +31,13 @@ def complete_jedi(prefix, line, start, end, ctx): src = builtins.__xonsh__.shell.shell.accumulated_inputs + line script = jedi.api.Interpreter(src, [ctx], column=end) if builtins.__xonsh__.env.get('CASE_SENSITIVE_COMPLETIONS'): - rtn = {x.name_with_symbols for x in script.completions() - if x.name_with_symbols.startswith(prefix)} + rtn = {x.name_with_symbols for x in script.completions() + if x.name_with_symbols.startswith(prefix)} else: - rtn = {x.name_with_symbols for x in script.completions()} + try: + rtn = {x.name_with_symbols for x in script.completions()} + except Exception: + rtn = set() return rtn